async function Vips(moduleArg={}){var moduleRtn;var n=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,t=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type,v=ba&&"em-pthread"==globalThis.name;if(t){const {createRequire:a}=await import("node:module");var require=a(import.meta.url),worker_threads=require("node:worker_threads");global.Worker=worker_threads.Worker;v=(ba=!worker_threads.isMainThread)&&"em-pthread"==worker_threads.workerData}
n.dynamicLibraries=n.dynamicLibraries||["vips-jxl.wasm","vips-heif.wasm"];var ca=[],da="./this.program",fa=(a,b)=>{throw b;},ha=import.meta.url,ia="";function ja(a){return n.locateFile?n.locateFile(a,ia):ia+a}var ka,la;
if(t){var fs=require("node:fs");ha.startsWith("file:")&&(ia=require("node:path").dirname(require("node:url").fileURLToPath(ha))+"/");la=a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a)};ka=async a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(da=process.argv[1].replace(/\\/g,"/"));ca=process.argv.slice(2);fa=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba){try{ia=(new URL(".",ha)).href}catch{}t||(ba&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType=
"arraybuffer";b.send(null);return new Uint8Array(b.response)}),ka=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);})}var na=console.log.bind(console),oa=console.error.bind(console);if(t){var pa=require("node:util"),qa=a=>"object"==typeof a?pa.inspect(a):a;na=(...a)=>fs.writeSync(1,a.map(qa).join(" ")+"\n");oa=(...a)=>fs.writeSync(2,a.map(qa).join(" ")+"\n")}var ra=na,w=oa,sa=[],ta,ua,va=!1,wa,ma=a=>a.startsWith("file://");
class x extends Error{}class xa extends x{}class ya extends x{constructor(a){super(a);this.ga=a;a=za(a instanceof ya?a.ga:a);this.name=a[0];this.message=a[1]}}var Aa,Ba;if(t&&v){globalThis.self=globalThis;var Ca=worker_threads.parentPort;globalThis.postMessage||(Ca.on("message",a=>globalThis.onmessage?.({data:a})),globalThis.postMessage=a=>Ca.postMessage(a));process.on("uncaughtException",a=>{postMessage({S:"uncaughtException",error:a});process.exit(1)})}var Da={},Ea;
if(v){var Ga=!1;self.onunhandledrejection=b=>{throw b.reason||b;};function a(b){try{var c=b.data,d=c.S;if("load"===d){let e=[];self.onmessage=f=>e.push(f);Ea=()=>{postMessage({S:"loaded"});for(let f of e)a(f);self.onmessage=a};sa=c.Eb;Da=c.nc;for(const f of c.Rb)if(!n[f]||n[f].proxy)n[f]=(...g)=>{postMessage({S:"callHandler",Qb:f,args:g})},"print"==f&&(ra=n[f]),"printErr"==f&&(w=n[f]);Ha=c.uc;Ia();ua=c.vc;Ja();Ka()}else if("run"===d){La(c.Z);Ma(c.Z,0,0,1,0,0);Na();Oa(c.Z);Ga||(Pa(),Ga=!0);try{Qa(c.qc,
c.Da)}catch(e){if("unwind"!=e)throw e;}}else"setimmediate"!==c.target&&("checkMailbox"===d?Ga&&Sa():d&&(w(`worker: received unknown command ${d}`),w(c)))}catch(e){throw Ta(),e;}}self.onmessage=a}var y,z,B,C,E,F,Ua,Va,J,Wa,Xa=!1,Ya=!1;function Ia(){var a=Ha.buffer;y=new Int8Array(a);B=new Int16Array(a);z=new Uint8Array(a);C=new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Ua=new Float32Array(a);Va=new Float64Array(a);J=new BigInt64Array(a);Wa=new BigUint64Array(a)}var Za=[];
function $a(){Xa=!0;v?Ea():(ab(Za),n.noFSInit||FS.Ia||FS.init(),bb.__wasm_call_ctors(),ab(cb),FS.gb=!1)}function db(a){n.onAbort?.(a);a="Aborted("+a+")";w(a);va=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");Ba?.(a);throw a;}var eb;async function fb(a){if(!ta)try{var b=await ka(a);return new Uint8Array(b)}catch{}if(a==eb&&ta)a=new Uint8Array(ta);else if(la)a=la(a);else throw"both async and sync fetching of the wasm failed";return a}
async function gb(a,b){try{var c=await fb(a);return await WebAssembly.instantiate(c,b)}catch(d){w(`failed to asynchronously prepare wasm: ${d}`),db(d)}}async function ib(a){var b=eb;if(!ta&&!t)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){w(`wasm streaming compile failed: ${d}`),w("falling back to ArrayBuffer instantiation")}return gb(b,a)}
function jb(){K={__assert_fail:kb,__call_sighandler:lb,__cxa_begin_catch:mb,__cxa_end_catch:nb,__cxa_find_matching_catch_2:ob,__cxa_find_matching_catch_3:pb,__cxa_rethrow:qb,__cxa_throw:rb,__cxa_uncaught_exceptions:sb,__lsan_ignore_object:tb,__pthread_create_js:ub,__resumeException:vb,__syscall_dup:wb,__syscall_faccessat:xb,__syscall_fcntl64:yb,__syscall_fstat64:zb,__syscall_ftruncate64:Ab,__syscall_getcwd:Bb,__syscall_ioctl:Cb,__syscall_lstat64:Db,__syscall_newfstatat:Eb,__syscall_openat:Fb,__syscall_poll:Gb,
__syscall_rmdir:Hb,__syscall_stat64:Ib,__syscall_unlinkat:Lb,_abort_js:Mb,_dlopen_js:Nb,_dlsym_catchup_js:Ob,_dlsym_js:Pb,_embind_finalize_value_object:Qb,_embind_register_arithmetic_vector:Rb,_embind_register_bigint:Sb,_embind_register_bool:Tb,_embind_register_class:Ub,_embind_register_class_class_function:Vb,_embind_register_class_constructor:Wb,_embind_register_class_function:Xb,_embind_register_class_property:Yb,_embind_register_emval:Zb,_embind_register_enum:$b,_embind_register_enum_value:ac,
_embind_register_float:bc,_embind_register_function:cc,_embind_register_integer:dc,_embind_register_iterable:ec,_embind_register_memory_view:fc,_embind_register_optional:gc,_embind_register_std_string:hc,_embind_register_std_wstring:ic,_embind_register_value_object:jc,_embind_register_value_object_field:kc,_embind_register_void:lc,_emscripten_dlopen_js:mc,_emscripten_dlsync_threads:nc,_emscripten_get_dynamic_libraries_js:oc,_emscripten_init_main_thread_js:pc,_emscripten_notify_mailbox_postmessage:qc,
_emscripten_receive_on_main_thread_js:rc,_emscripten_runtime_keepalive_clear:sc,_emscripten_thread_cleanup:tc,_emscripten_thread_exit_joinable:uc,_emscripten_thread_mailbox_await:Oa,_emscripten_thread_set_strongref:vc,_emscripten_throw_longjmp:wc,_emval_array_to_memory_view:xc,_emval_create_invoker:yc,_emval_decref:zc,_emval_get_global:Ac,_emval_get_module_property:Bc,_emval_get_property:Cc,_emval_incref:Dc,_emval_instanceof:Ec,_emval_invoke:Fc,_emval_is_number:Gc,_emval_is_string:Hc,_emval_new_cstring:Ic,
_emval_run_destructors:Jc,_emval_set_property:Kc,_emval_typeof:Lc,_gmtime_js:Mc,_localtime_js:Nc,_mmap_js:Oc,_munmap_js:Pc,_tzset_js:Qc,clock_time_get:Rc,emscripten_check_blocking_allowed:Sc,emscripten_date_now:Tc,emscripten_err:Uc,emscripten_exit_with_live_runtime:Vc,emscripten_get_heap_max:Wc,emscripten_get_now:Xc,emscripten_num_logical_cores:Yc,emscripten_promise_destroy:Zc,emscripten_promise_resolve:$c,emscripten_resize_heap:ad,environ_get:bd,environ_sizes_get:cd,exit:dd,fd_close:ed,fd_fdstat_get:fd,
fd_read:gd,fd_seek:hd,fd_write:jd,ffi_call_js:kd,heif_color_conversion_options_ext_copy:ld,heif_color_conversion_options_ext_free:md,heif_encoding_options_alloc:nd,heif_encoding_options_free:od,heif_error_success:pd,heif_image_get_plane_readonly2:qd,heif_image_release:rd,heif_nclx_color_profile_alloc:sd,heif_nclx_color_profile_free:td,heif_tai_clock_info_copy:ud,heif_tai_clock_info_release:vd,heif_tai_timestamp_packet_copy:wd,heif_tai_timestamp_packet_release:xd,invoke_di:yd,invoke_dii:zd,invoke_diii:Ad,
invoke_diiiii:Bd,invoke_ff:Cd,invoke_fi:Dd,invoke_fii:Ed,invoke_fiii:Fd,invoke_i:Gd,invoke_ii:Hd,invoke_iii:Id,invoke_iiid:Jd,invoke_iiii:Kd,invoke_iiiii:Ld,invoke_iiiiid:Md,invoke_iiiiii:Nd,invoke_iiiiiidii:Od,invoke_iiiiiififff:Pd,invoke_iiiiiii:Qd,invoke_iiiiiiii:Rd,invoke_iiiiiiiii:Sd,invoke_iiiiiiiiii:Td,invoke_iiiiiiiiiii:Ud,invoke_iiiiiiiiiiii:Vd,invoke_iiiiiiiiiiiii:Wd,invoke_iiiiij:Xd,invoke_ji:Yd,invoke_jiiii:Zd,invoke_v:$d,invoke_vi:ae,invoke_vid:be,invoke_viddi:ce,invoke_vifff:de,invoke_vii:ee,
invoke_viid:fe,invoke_viidd:ge,invoke_viiddi:he,invoke_viidi:ie,invoke_viii:je,invoke_viiid:ke,invoke_viiidddddi:le,invoke_viiiddddi:me,invoke_viiidddi:ne,invoke_viiiddi:oe,invoke_viiidi:pe,invoke_viiii:qe,invoke_viiiii:re,invoke_viiiiii:se,invoke_viiiiiii:te,invoke_viiiiiiidd:ue,invoke_viiiiiiii:ve,invoke_viiiiiiiii:we,invoke_viiiiiiiiii:xe,invoke_viiiiiiiiiii:ye,invoke_viiiiiiiiiiii:ze,invoke_viiiiiiiiiiiii:Ae,invoke_viiiiiiiiiiiiiii:Be,memory:Ha,proc_exit:Ce,random_get:De};var a=new Proxy(new Set(["__lsan_ignore_object"]),
Ee);return{env:K,wasi_snapshot_preview1:K,"GOT.mem":a,"GOT.func":a}}
async function Ja(){function a(d,e){var f=bb=d.exports;Fe(bb);var g=Ge(e);He(bb._emscripten_tls_init,d.exports,g);d=bb;Ie=d.pthread_self;Je=d.malloc;n._main=d.main;Ke=d.free;Le=d.fflush;Me=d.calloc;n.__ZnamSt11align_val_t=d._ZnamSt11align_val_t;Ne=d.__getTypeName;Pa=d._embind_initialize_bindings;n._emscripten_builtin_free=d.emscripten_builtin_free;Oe=d.emscripten_builtin_memalign;n._emscripten_builtin_malloc=d.emscripten_builtin_malloc;Pe=d.__funcs_on_exit;n.___libc_calloc=d.__libc_calloc;n.___libc_free=
d.__libc_free;n.___libc_malloc=d.__libc_malloc;Qe=d.__dl_seterr;Re=d._emscripten_dlsync_self_async;Se=d._emscripten_dlsync_self;Te=d._emscripten_proxy_dlsync_async;Ue=d._emscripten_proxy_dlsync;Ve=d._emscripten_find_dylib;Ma=d._emscripten_thread_init;Ta=d._emscripten_thread_crashed;We=d._emscripten_run_js_on_main_thread_done;Xe=d._emscripten_run_js_on_main_thread;Ye=d._emscripten_thread_free_data;Ze=d._emscripten_thread_exit;n._strndup=d.strndup;$e=d._emscripten_check_mailbox;n.__ZdaPvm=d._ZdaPvm;
n.___libc_realloc=d.__libc_realloc;n._emscripten_builtin_calloc=d.emscripten_builtin_calloc;n._emscripten_builtin_realloc=d.emscripten_builtin_realloc;n._malloc_size=d.malloc_size;n._malloc_usable_size=d.malloc_usable_size;n._reallocf=d.reallocf;af=d.emscripten_get_sbrk_ptr;L=d.setThrew;bf=d._emscripten_tempret_set;cf=d.emscripten_stack_set_limits;M=d._emscripten_stack_restore;df=d._emscripten_stack_alloc;N=d.emscripten_stack_get_current;ef=d.__cxa_decrement_exception_refcount;ff=d.__cxa_increment_exception_refcount;
gf=d.__get_exception_message;hf=d.__cxa_can_catch;jf=d.__cxa_get_exception_ptr;kf=d.__indirect_function_table;lf=d.__heap_base.value;mf(f);nf("__main__",0,K);of();ua=e;return bb}var b=jb();if(n.instantiateWasm)return new Promise(d=>{n.instantiateWasm(b,(e,f)=>{d(a(e,f))})});if(v){var c=new WebAssembly.Instance(ua,jb());return a(c,ua)}eb??=n.locateFile?ja("vips.wasm"):(new URL("vips.wasm",import.meta.url)).href;return function(d){return a(d.instance,d.module)}(await ib(b))}
class pf{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var qf={},Ee={get(a,b){var c=qf[b];c||=qf[b]=new WebAssembly.Global({value:"i32",mutable:!0},-1);a.has(b)||(c.required=!0);return c}},rf=a=>{a.terminate();a.onmessage=()=>{}},xf=a=>{var b=sf[a];tf.delete(a);a in uf&&uf[a].resolve();a=b.Z;delete sf[a];vf.push(b);wf.splice(wf.indexOf(b),1);b.Z=0;Ye(a)},ab=a=>{for(;0<a.length;)a.shift()(n)},yf=[],zf=a=>{tf.add(a);a in uf&&uf[a].resolve()},Bf=a=>{if(0==vf.length){if(n.mainScriptUrlOrBlob){var b=n.mainScriptUrlOrBlob;"string"!=typeof b&&(b=URL.createObjectURL(b));
b=new Worker(b,{type:"module",workerData:"em-pthread",name:"em-pthread"})}else b=new Worker(new URL("vips-node.mjs",import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});vf.push(b);Af()}b=vf.pop();if(!b)return 6;wf.push(b);sf[a.Z]=b;b.Z=a.Z;var c={S:"run",qc:a.pc,Da:a.Da,Z:a.Z};t&&b.unref();b.postMessage(c,a.sb);return 0},Cf=0,O=(a,b,...c)=>{var d=16*c.length,e=N(),f=df(d),g=f>>3,h;for(h of c)"bigint"==typeof h?(J[g++]=1n,J[g++]=h):(J[g++]=0n,Va[g++]=h);a=Xe(a,
0,d,f,b);M(e);return a};function Ce(a){if(v)return O(0,1,a);wa=a;Df||0<Cf||(Ef(),n.onExit?.(a),va=!0);fa(a,new pf(a))}Ce.h="vi";function Ff(a){if(v)return O(1,0,a);dd(a)}var dd=a=>{wa=a;if(v)throw Ff(a),"unwind";if(!(Df||0<Cf||v)){Pe();FS.Ia=!1;Le(0);for(var b of FS.streams)b&&FS.close(b);Ef();Ya=!0}Ce(a)};dd.h="vi";var vf=[],wf=[],Gf=[],sf={},Ef=()=>{for(var a of wf)rf(a);for(a of vf)rf(a);vf=[];wf=[];sf={}};function Na(){Gf.forEach(a=>a())}
var Af=()=>{var a=vf[0];new Promise(b=>{a.onmessage=f=>{var g=f.data;f=g.S;if(g.Ca&&g.Ca!=Ie()){var h=sf[g.Ca];h?h.postMessage(g,g.sb):w(`Internal error! Worker sent a message "${f}" to target pthread ${g.Ca}, but that thread no longer exists!`)}else if("checkMailbox"===f)Sa();else if("spawnThread"===f)Bf(g);else if("cleanupThread"===f)Hf(()=>xf(g.Wa));else if("markAsFinished"===f)zf(g.Wa);else if("loaded"===f)a.loaded=!0,b(a);else if("setimmediate"===g.target)a.postMessage(g);else if("uncaughtException"===
f)a.onerror(g.error);else if("callHandler"===f)n[g.Qb](...g.args);else f&&w(`worker sent an unknown command ${f}`)};a.onerror=f=>{w(`${"worker sent an error!"} ${f.filename}:${f.lineno}: ${f.message}`);throw f;};t&&(a.on("message",f=>a.onmessage({data:f})),a.on("error",f=>a.onerror(f)));var c=[],d=["onExit","onAbort","print","printErr"],e;for(e of d)n.propertyIsEnumerable(e)&&c.push(e);a.postMessage({S:"load",Rb:c,uc:Ha,vc:ua,Eb:sa,nc:Da})})},tf,uf,If,Jf=[];
function La(a){var b=F[a+52>>2];cf(b,b-F[a+56>>2]);M(b)}
var Kf=new TextDecoder,Lf=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},Mf=(a,b=0,c)=>{c=Lf(a,b,c);return Kf.decode(a.buffer?a.buffer instanceof ArrayBuffer?a.subarray(b,c):a.slice(b,c):new Uint8Array(a.slice(b,c)))},Ge=a=>{function b(){for(var p=0,r=1;;){var q=a[f++];p+=(q&127)*r;r*=128;if(!(q&128))break}return p}function c(){var p=b();f+=p;return Mf(a,f-p,p)}function d(){for(var p=b(),r=[];p--;)r.push(c());return r}function e(p,r){if(p)throw Error(r);}var f=0,g=0;if(a instanceof
WebAssembly.Module)g=WebAssembly.Module.customSections(a,"dylink.0"),e(0===g.length,"need dylink section"),a=new Uint8Array(g[0]),g=a.length;else{g=1836278016==(new Uint32Array((new Uint8Array(a.subarray(0,24))).buffer))[0];e(!g,"need to see wasm magic number");e(0!==a[8],"need the dylink section to be first");f=9;g=b();g=f+g;var h=c();e("dylink.0"!==h)}for(h={Na:[],rb:new Set,ub:new Set,qb:[]};f<g;){var k=a[f++],l=b();if(1===k)h.Ma=b(),h.Yb=b(),h.ua=b(),h.Kc=b();else if(2===k)h.Na=d();else if(3===
k)for(k=b();k--;){l=c();var m=b();m&256&&h.rb.add(l)}else if(4===k)for(k=b();k--;)c(),l=c(),m=b(),1==(m&3)&&h.ub.add(l);else 5===k?h.qb=d():f+=l}return h},Nf=[],P=a=>{var b=Nf[a];b||(Nf[a]=b=kf.get(a));return b},Qa=(a,b)=>{Df=Cf=0;Se();a=P(a)(b);Df||0<Cf?wa=a:Ze(a)},nf=(a,b,c)=>{c={ma:Infinity,name:a,exports:c,global:!0};Of[a]=c;void 0!=b&&(Pf[b]=c);return c},Of={},Pf={},Qf=(a,b)=>Math.ceil(a/b)*b,Rf=a=>{if(Xa)return Me(a,1);var b=lf;lf=a=b+16*Math.ceil(a/16);if(!v){var c=af();F[c>>2]=a}return b},
Tf=(a,b)=>{if(Sf)for(var c=a;c<a+b;c++){var d=P(c);d&&Sf.set(d,c)}},Sf,Uf=a=>{Sf||(Sf=new WeakMap,Tf(0,kf.length));return Sf.get(a)||0},Vf=[],Wf=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Xf={i:127,p:127,j:126,f:125,d:124,e:111},Yf=a=>Wf(Array.from(a,b=>Xf[b])),Zf=(a,b)=>{var c=Uf(a);if(c)return c;c=Vf.length?Vf.pop():kf.grow(1);try{kf.set(c,a),Nf[c]=kf.get(c)}catch(d){if(!(d instanceof TypeError))throw d;b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Wf([1,96,...Yf(b.slice(1)),...Yf("v"===b[0]?
"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;kf.set(c,b);Nf[c]=kf.get(c)}Sf.set(a,c);return c},mf=(a,b)=>{for(var c in a){var d=c;if(!"memory __memory_base __table_base __stack_pointer __indirect_function_table __cpp_exception __c_longjmp __wasm_apply_data_relocs __dso_handle __tls_size __tls_align __set_stack_limits _emscripten_tls_init __wasm_init_tls __wasm_call_ctors __start_em_asm __stop_em_asm __start_em_js __stop_em_js".split(" ").includes(d)&&
!d.startsWith("__em_js__")){d=a[c];var e=qf[c]&&-1!=qf[c].value;if(b||!e){if("function"==typeof d)d=Zf(d);else if("number"!=typeof d.value)continue;let f;qf[f=c]??(qf[f]=new WebAssembly.Global({value:"i32",mutable:!0}));qf[c].value=d}}}},$f=(a,b=0)=>{var c={},d;for(d in a){var e=d;var f=a[d];a:{if(f instanceof WebAssembly.Global)try{f.value=f.value}catch{var g=!0;break a}g=!1}f=g?new WebAssembly.Global({value:"i32"},f.value+b):f;c[e]=f}return c},ag=a=>{a=K[a];return!a||a.L?!1:!0},bg=(a,b)=>Object.defineProperty(b,
"name",{value:a}),cg=(a,b=[])=>P(a)(...b),dg=a=>(b,...c)=>{var d=N();try{return cg(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0);if("j"==a[0])return 0n}},fg=a=>{var b;ag(a)?b=K[a]:a.startsWith("invoke_")?b=K[a]=bg(a,dg(a.split("_")[1])):a.startsWith("__cxa_find_matching_catch_")&&(b=K[a]=bg(a,(...c)=>eg(c)));return{Va:b,name:a}},cb=[],Q=(a,b,c)=>a?Kf.decode(z.slice(a,Lf(z,a,b,c))):"",kg=(a,b,c,d,e)=>{function f(){function k(G,D){function H(Fa,ea){Fa=[];for(var Jb=0;;Jb++){var hb="$"+Jb;if(!ea.includes(hb))break;
Fa.push(hb)}Fa=Fa.join(",");gg[I]=eval(`(${Fa}) => { ${ea} };`)}function R(Fa,ea,Jb){var hb=[];ea=ea.slice(1,-1);if("void"!=ea){ea=ea.split(",");for(var ri of ea)ea=ri.split(" ").pop(),hb.push(ea.replaceAll("*",""))}q[Fa]=eval(`(${hb}) => ${Jb};`)}!v&&c&&(Da[c]=G);Tf(r,g.ua);q=$f(D.exports,p);mf(q);b.yb||hg();if("__start_em_asm"in q){var I=q.__start_em_asm.value;for(G=q.__stop_em_asm.value;I<G;){var Ra=Q(I);H(I,Ra);I=z.indexOf(0,I)+1}}for(var Kb in q)if(Kb.startsWith("__em_js__")){I=q[Kb].value;Ra=
Q(I);var [si,ti]=Ra.split("<::>");R(Kb.replace("__em_js__",""),si,ti);delete q[Kb]}He(q._emscripten_tls_init,D.exports,g);l&&((D=q.__wasm_apply_data_relocs)&&(Xa?D():Za.push(D)),(D=q.__wasm_call_ctors)&&(Xa?D():cb.push(D)));return q}var l=!e||!y[e+8];if(l){var m=Math.pow(2,g.Yb),p=g.Ma?Qf(Rf(g.Ma+m),m):0,r=g.ua?kf.length:0;e&&(y[e+8]=1,F[e+12>>2]=p,E[e+16>>2]=g.Ma,F[e+20>>2]=r,E[e+24>>2]=g.ua)}else p=F[e+12>>2],r=F[e+20>>2];g.ua&&kf.grow(g.ua);var q;m=new Proxy({},{get(G,D){switch(D){case "__memory_base":return p;
case "__table_base":return r}if(D in K&&!K[D].L)return K[D];if(!(D in G)){var H;G[D]=(...R)=>{if(!H){var I=fg(D).Va;!I&&d&&(I=d[D]);I||=q[D];H=I}return H(...R)}}return G[D]}});var u=new Proxy(g.ub,Ee),A={"GOT.mem":u,"GOT.func":u,env:m,wasi_snapshot_preview1:m};if(b.J)return(async()=>{var G;a instanceof WebAssembly.Module?G=new WebAssembly.Instance(a,A):{module:a,instance:G}=await WebAssembly.instantiate(a,A);return k(a,G)})();m=a instanceof WebAssembly.Module?a:new WebAssembly.Module(a);u=new WebAssembly.Instance(m,
A);return k(m,u)}var g=Ge(a);b={...b,Ta:{bc:c,ec:g.qb}};if(b.J)return g.Na.reduce((k,l)=>k.then(()=>{l=ig(l,b.Ta)??l;return jg(l,b,d)}),Promise.resolve()).then(f);for(var h of g.Na)h=ig(h,b.Ta)??h,jg(h,b,d);return f()},Fe=a=>{var b,c;for([b,c]of Object.entries(a))ag(b)||(K[b]=c)},lg=async a=>{a=await ka(a);return new Uint8Array(a)},mg=[],ng={},og=require("node:path"),pg=og.isAbsolute,qg=og.normalize,rg=og.dirname,sg=og.basename,tg=og.join,ug=og.join,vg=a=>{var b=N();a=a();M(b);return a},wg=a=>{for(var b=
0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},xg=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var f=0;f<a.length;++f){var g=a.codePointAt(f);if(127>=g){if(c>=d)break;b[c++]=g}else if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6;b[c++]=128|g&63}else if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12;b[c++]=128|g>>6&63;b[c++]=128|g&63}else{if(c+3>=d)break;b[c++]=240|g>>18;b[c++]=128|g>>12&63;b[c++]=128|g>>6&63;b[c++]=128|g&63;f++}}b[c]=
0;return c-e},yg=a=>{var b=wg(a)+1,c=df(b);xg(a,z,c,b);return c},zg=()=>{if(t){var a=require("node:crypto");return b=>a.randomFillSync(b)}return b=>b.set(crypto.getRandomValues(new Uint8Array(b.byteLength)))},Ag=a=>{(Ag=zg())(a)},Bg=(...a)=>{a.unshift(FS.cwd());return og.posix.resolve(...a)},Cg=(a,b)=>og.posix.relative(a||FS.cwd(),b||FS.cwd()),Dg=[],Eg=a=>{var b=Array(wg(a)+1);a=xg(a,b,0,b.length);b.length=a;return b},Fg=[];
function Gg(a,b){Fg[a]={input:[],output:[],fa:b};FS.registerDevice(a,Hg)}
var Hg={open(a){var b=Fg[a.node.rdev];if(!b)throw new FS.g(43);a.tty=b;a.seekable=!1},close(a){a.tty.fa.fsync(a.tty)},fsync(a){a.tty.fa.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.fa.fb)throw new FS.g(60);for(var e=0,f=0;f<d;f++){try{var g=a.tty.fa.fb(a.tty)}catch(h){throw new FS.g(29);}if(void 0===g&&0===e)throw new FS.g(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.atime=Date.now());return e},write(a,b,c,d){if(!a.tty||!a.tty.fa.Qa)throw new FS.g(60);try{for(var e=0;e<d;e++)a.tty.fa.Qa(a.tty,
b[c+e])}catch(f){throw new FS.g(29);}d&&(a.node.mtime=a.node.ctime=Date.now());return e}},Ig={fb(){a:{if(!Dg.length){var a=null;if(t){var b=Buffer.alloc(256),c=0,d=process.stdin.fd;try{c=fs.readSync(d,b,0,256)}catch(e){if(e.toString().includes("EOF"))c=0;else throw e;}0<c&&(a=b.slice(0,c).toString("utf-8"))}if(!a){a=null;break a}Dg=Eg(a)}a=Dg.shift()}return a},Qa(a,b){null===b||10===b?(ra(Mf(a.output)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(ra(Mf(a.output)),a.output=[])},
Tb(){return{Bc:25856,Dc:5,Ac:191,Cc:35387,zc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},Jg={Qa(a,b){null===b||10===b?(w(Mf(a.output)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(w(Mf(a.output)),a.output=[])}},Kg=a=>{a=65536*Math.ceil(a/65536);var b=Oe(65536,a);b&&z.fill(0,b,b+a);return b},S={Y:null,mount(){return S.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(FS.isBlkdev(c)||FS.isFIFO(c))throw new FS.g(63);
S.Y||(S.Y={dir:{node:{I:S.o.I,K:S.o.K,lookup:S.o.lookup,T:S.o.T,rename:S.o.rename,unlink:S.o.unlink,rmdir:S.o.rmdir,readdir:S.o.readdir,symlink:S.o.symlink},stream:{llseek:S.m.llseek}},file:{node:{I:S.o.I,K:S.o.K},stream:{llseek:S.m.llseek,read:S.m.read,write:S.m.write,X:S.m.X,da:S.m.da}},link:{node:{I:S.o.I,K:S.o.K,readlink:S.o.readlink},stream:{}},Xa:{node:{I:S.o.I,K:S.o.K},stream:FS.Ab}});c=FS.createNode(a,b,c,d);FS.isDir(c.mode)?(c.o=S.Y.dir.node,c.m=S.Y.dir.stream,c.v={}):FS.isFile(c.mode)?(c.o=
S.Y.file.node,c.m=S.Y.file.stream,c.O=0,c.v=S.Fb??(S.Fb=new Uint8Array(0))):FS.isLink(c.mode)?(c.o=S.Y.link.node,c.m=S.Y.link.stream):FS.isChrdev(c.mode)&&(c.o=S.Y.Xa.node,c.m=S.Y.Xa.stream);c.atime=c.mtime=c.ctime=Date.now();a&&(a.v[b]=c,a.atime=a.mtime=a.ctime=c.atime);return c},o:{I(a){var b={};b.dev=FS.isChrdev(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;FS.isDir(a.mode)?b.size=4096:FS.isFile(a.mode)?b.size=a.O:FS.isLink(a.mode)?b.size=a.link.length:b.size=
0;b.atime=new Date(a.atime);b.mtime=new Date(a.mtime);b.ctime=new Date(a.ctime);b.blksize=4096;b.blocks=Math.ceil(b.size/b.blksize);return b},K(a,b){for(var c of["mode","atime","mtime","ctime"])null!=b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.O!=b&&(c=a.v,a.v=new Uint8Array(b),a.v.set(c.subarray(0,Math.min(b,a.O))),a.O=b))},lookup(){S.Ea||(S.Ea=new FS.g(44),S.Ea.stack="<generic error, no stack>");throw S.Ea;},T(a,b,c,d){return S.createNode(a,b,c,d)},rename(a,b,c){try{var d=Lg(b,c)}catch(f){}if(d){if(FS.isDir(a.mode))for(var e in d.v)throw new FS.g(55);
Mg(d)}delete a.parent.v[a.name];b.v[c]=a;a.name=c;b.ctime=b.mtime=a.parent.ctime=a.parent.mtime=Date.now()},unlink(a,b){delete a.v[b];a.ctime=a.mtime=Date.now()},rmdir(a,b){var c=Lg(a,b),d;for(d in c.v)throw new FS.g(55);delete a.v[b];a.ctime=a.mtime=Date.now()},readdir(a){return[".","..",...Object.keys(a.v)]},symlink(a,b,c){a=S.createNode(a,b,41471,0);a.link=c;return a},readlink(a){if(!FS.isLink(a.mode))throw new FS.g(28);return a.link}},m:{read(a,b,c,d,e){if(e>=a.node.O)return 0;d=Math.min(a.node.O-
e,d);b.set(a.node.v.subarray(e,e+d),c);return d},write(a,b,c,d,e,f){if(!d)return 0;a=a.node;a.mtime=a.ctime=Date.now();if(f)a.v=b.subarray(c,c+d),a.O=d;else if(0===a.O&&0===e)a.v=b.slice(c,c+d),a.O=d;else{f=e+d;var g=a.v.length;g>=f||(f=Math.max(f,g*(1048576>g?2:1.125)>>>0),g&&(f=Math.max(f,256)),g=a.v.subarray(0,a.O),a.v=new Uint8Array(f),a.v.set(g));a.v.set(b.subarray(c,c+d),e);a.O=Math.max(a.O,e+d)}return d},llseek(a,b,c){1===c?b+=a.position:2===c&&FS.isFile(a.node.mode)&&(b+=a.node.O);if(0>b)throw new FS.g(28);
return b},X(a,b,c,d,e){if(!FS.isFile(a.node.mode))throw new FS.g(43);a=a.node.v;if(e&2||a.buffer!==y.buffer){d=!0;e=Kg(b);if(!e)throw new FS.g(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);y.set(a,e)}}else d=!1,e=a.byteOffset;return{s:e,W:d}},da(a,b,c,d){S.m.write(a,b,0,d,c,!1);return 0}}},Ng=a=>{if("string"!=typeof a)return a;var b={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[a];if("undefined"==typeof b)throw Error(`Unknown file open mode: ${a}`);
return b},Og=a=>{"string"==typeof a&&(a=Eg(a));a.subarray||(a=new Uint8Array(a));return a},Pg=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},Qg={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,
ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,
ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,
ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function T(a){try{return a()}catch(b){if(!b.code)throw b;if("UNKNOWN"===b.code)throw new FS.g(28);throw new FS.g(Qg[b.code]);}}function Rg(a){return T(()=>{var b=fs.lstatSync(a).mode;NODEFS.na&&(b|=(b&292)>>2);return b})}function Sg(a){for(var b=[];a.parent!==a;)b.push(a.name),a=a.parent;b.push(a.mount.Pa.root);b.reverse();return tg(...b)}
function Tg(a){a&=-2721793;var b=0,c;for(c in NODEFS.cb)a&c&&(b|=NODEFS.cb[c],a^=c);if(a)throw new FS.g(28);return b}
var NODEFS={na:!1,Ua(){NODEFS.na=!!process.platform.match(/^win/);var a=process.binding("constants").fs;NODEFS.cb={1024:a.O_APPEND,64:a.O_CREAT,128:a.O_EXCL,256:a.O_NOCTTY,0:a.O_RDONLY,2:a.O_RDWR,4096:a.O_SYNC,512:a.O_TRUNC,1:a.O_WRONLY,131072:a.O_NOFOLLOW}},mount(a){return NODEFS.createNode(null,"/",Rg(a.Pa.root),0)},createNode(a,b,c){if(!FS.isDir(c)&&!FS.isFile(c)&&!FS.isLink(c))throw new FS.g(28);a=FS.createNode(a,b,c);a.o=NODEFS.o;a.m=NODEFS.m;return a},I(a,b){a=T(a);NODEFS.na&&(a.blksize||(a.blksize=
4096),a.blocks||(a.blocks=(a.size+a.blksize-1)/a.blksize|0),a.mode|=(a.mode&292)>>2);return{dev:a.dev,ino:b.id,mode:a.mode,nlink:a.nlink,uid:a.uid,gid:a.gid,rdev:a.rdev,size:a.size,atime:a.atime,mtime:a.mtime,ctime:a.ctime,blksize:a.blksize,blocks:a.blocks}},K(a,b,c,d,e,f,g){T(()=>{if(void 0!==c.mode){var h=c.mode;NODEFS.na&&(h&=384);d(a,h);b.mode=c.mode}if("number"===typeof(c.atime??c.mtime)){h=new Date(c.atime??g(a).atime);var k=new Date(c.mtime??g(a).mtime);e(a,h,k)}void 0!==c.size&&f(a,c.size)})},
o:{I(a){var b=Sg(a);return NODEFS.I(()=>fs.lstatSync(b),a)},K(a,b){var c=Sg(a);if(null!=b.mode&&b.Fa)throw new FS.g(52);NODEFS.K(c,a,b,fs.chmodSync,fs.utimesSync,fs.truncateSync,fs.lstatSync)},lookup(a,b){var c=ug(Sg(a),b);c=Rg(c);return NODEFS.createNode(a,b,c)},T(a,b,c,d){var e=NODEFS.createNode(a,b,c,d),f=Sg(e);T(()=>{FS.isDir(e.mode)?fs.mkdirSync(f,e.mode):fs.writeFileSync(f,"",{mode:e.mode})});return e},rename(a,b,c){var d=Sg(a),e=ug(Sg(b),c);try{FS.unlink(e)}catch(f){}T(()=>fs.renameSync(d,
e));a.name=c},unlink(a,b){var c=ug(Sg(a),b);T(()=>fs.unlinkSync(c))},rmdir(a,b){var c=ug(Sg(a),b);T(()=>fs.rmdirSync(c))},readdir(a){var b=Sg(a);return T(()=>fs.readdirSync(b))},symlink(a,b,c){var d=ug(Sg(a),b);T(()=>fs.symlinkSync(c,d))},readlink(a){var b=Sg(a);return T(()=>fs.readlinkSync(b))},ta(a){var b=T(()=>fs.sc(a));b.Jb=b.zb;return b}},m:{I(a){return NODEFS.I(()=>fs.fstatSync(a.D),a.node)},K(a,b){NODEFS.K(a.D,a.node,b,fs.fchmodSync,fs.futimesSync,fs.ftruncateSync,fs.fstatSync)},open(a){var b=
Sg(a.node);T(()=>{a.V.ma=1;a.D=fs.openSync(b,Tg(a.flags))})},close(a){T(()=>{a.D&&0===--a.V.ma&&fs.closeSync(a.D)})},Db(a){a.V.ma++},read(a,b,c,d,e){return T(()=>fs.readSync(a.D,b,c,d,e))},write(a,b,c,d,e){return T(()=>fs.writeSync(a.D,b,c,d,e))},llseek(a,b,c){var d=b;1===c?d+=a.position:2===c&&FS.isFile(a.node.mode)&&T(()=>{d+=fs.fstatSync(a.D).size});if(0>d)throw new FS.g(28);return d},X(a,b,c){if(!FS.isFile(a.node.mode))throw new FS.g(43);var d=Kg(b);NODEFS.m.read(a,y,d,b,c);return{s:d,W:!0}},
da(a,b,c,d){NODEFS.m.write(a,b,0,d,c,!1);return 0}}},Ug={lookup(a,b){return FS.lookupPath(`${a.path}/${b}`).node},lookupPath(a,b={}){b.parent&&(a=rg(a));b=fs.lstatSync(a);var c=Rg(a);return{path:a,node:{id:b.ino,mode:c,o:Ug,path:a}}},Ya(){FS.ia({D:0,position:0,path:"/dev/stdin",flags:0,tty:!0,seekable:!1},0);for(var a=[,"/dev/stdout","/dev/stderr"],b=1;3>b;b++)FS.ia({D:b,position:0,path:a[b],flags:577,tty:!0,seekable:!1},b)},cwd(){return process.cwd()},chdir(...a){process.chdir(...a)},T(a,b){FS.isDir(a)?
fs.mkdirSync(a,b):fs.writeFileSync(a,"",{mode:b})},mkdir(...a){fs.mkdirSync(...a)},symlink(...a){fs.symlinkSync(...a)},rename(...a){fs.renameSync(...a)},rmdir(...a){fs.rmdirSync(...a)},readdir(...a){return[".",".."].concat(fs.readdirSync(...a))},unlink(...a){fs.unlinkSync(...a)},readlink(...a){return fs.readlinkSync(...a)},stat(a,b){a=b?fs.lstatSync(a):fs.statSync(a);NODEFS.na&&(a.mode|=(a.mode&292)>>2);return a},fstat(a){a=U(a);return fs.fstatSync(a.D)},ta(a){return Object.assign({Kb:42,flags:2,
Zb:255},fs.sc(a))},rc(a){return FS.ta(a.path)},chmod(a,b,c){b&=4095;NODEFS.na&&(b&=384);if(c&&fs.lstatSync(a).isSymbolicLink())throw new FS.g(138);fs.chmodSync(a,b)},fchmod(a,b){a=U(a);fs.fchmodSync(a.D,b)},chown(...a){fs.chownSync(...a)},fchown(a,b,c){a=U(a);fs.fchownSync(a.D,b,c)},truncate(a,b){if(0>b)throw new FS.g(28);return fs.truncateSync(a,b)},ftruncate(a,b){if(0>b)throw new FS.g(28);a=U(a);fs.ftruncateSync(a.D,b)},utime(){},open(a,b,c){b=Ng(b);var d=a.split("/").map(f=>f.slice(0,255)).join("/");
c=fs.openSync(d,Tg(b),c);var e=fs.fstatSync(c);if(b&65536&&!e.isDirectory())throw fs.closeSync(c),new FS.g(Qg.wc);d=Rg(d);return FS.ia({D:c,position:0,path:a,flags:b,node:{id:e.ino,mode:d,o:Ug,path:a},seekable:!0})},ia(a,b){a=Vg.ia(a,b);"undefined"==typeof a.V.Sa?a.V.Sa=1:a.V.Sa++;return a},close(a){FS.streams[a.fd]=null;!a.m&&0>=--a.V.Sa&&2<a.D&&fs.closeSync(a.D)},llseek(a,b,c){if(a.m)return Vg.llseek(a,b,c);if(1===c)b+=a.position;else if(2===c)b+=fs.fstatSync(a.D).size;else if(0!==c)throw new FS.g(28);
if(0>b)throw new FS.g(28);return a.position=b},read(a,b,c,d,e){if(a.m)return Vg.read(a,b,c,d,e);var f="undefined"!=typeof e;!f&&a.seekable&&(e=a.position);b=fs.readSync(a.D,b,c,d,e);f||(a.position+=b);return b},write(a,b,c,d,e){if(a.m)return Vg.write(a,b,c,d,e);a.flags&1024&&FS.llseek(a,0,2);var f="undefined"!=typeof e;!f&&a.seekable&&(e=a.position);b=fs.writeSync(a.D,b,c,d,e);f||(a.position+=b);return b},X(a,b,c,d,e){if(!b)throw new FS.g(28);if(a.m)return Vg.X(a,b,c,d,e);d=Kg(b);FS.read(a,y,d,b,
c);return{s:d,W:!0}},da(a,b,c,d,e){if(a.m)return Vg.da(a,b,c,d,e);FS.write(a,b,0,d,c);return 0},ya(){throw new FS.g(59);}},Wg=0,Xg=null,Yg=()=>{Wg--;n.monitorRunDependencies?.(Wg);if(0==Wg&&Xg){var a=Xg;Xg=null;a()}},Zg=()=>{Wg++;n.monitorRunDependencies?.(Wg)},$g=async(a,b)=>{"undefined"!=typeof Browser&&Browser.init();for(var c of mg)if(c.canHandle(b))return c.handle(a,b);return a},ah=async(a,b,c,d,e,f,g,h)=>{var k=b?Bg(ug(a,b)):a,l=`cp ${k}`;Zg(l);try{var m=c;"string"==typeof c&&(m=await lg(c));
m=await $g(m,k);h?.();f||FS.createDataFile(a,b,m,d,e,g)}finally{Yg(l)}};function Lg(a,b){var c=FS.isDir(a.mode)?(c=bh(a,"x"))?c:a.o.lookup?0:2:54;if(c)throw new FS.g(c);for(c=FS.ea[ch(a.id,b)];c;c=c.la){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return FS.lookup(a,b)}function Mg(a){var b=ch(a.parent.id,a.name);if(FS.ea[b]===a)FS.ea[b]=a.la;else for(b=FS.ea[b];b;){if(b.la===a){b.la=a.la;break}b=b.la}}function U(a){a=FS.eb(a);if(!a)throw new FS.g(8);return a}
function ch(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%FS.ea.length}function dh(a){var b=ch(a.parent.id,a.name);a.la=FS.ea[b];FS.ea[b]=a}function bh(a,b){return FS.gb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}function eh(a,b){if(!FS.isDir(a.mode))return 54;try{return Lg(a,b),20}catch(c){}return bh(a,"wx")}
function fh(a,b,c){try{var d=Lg(a,b)}catch(e){return e.A}if(a=bh(a,"wx"))return a;if(c){if(!FS.isDir(d.mode))return 54;if(FS.pa(d)||FS.getPath(d)===FS.cwd())return 10}else if(FS.isDir(d.mode))return 31;return 0}function gh(a,b){if(!a)throw new FS.g(b);return a}function hh(a,b=-1){a=FS.ia(a,b);a.m?.Db?.(a);return a}function ih(a,b,c){var d=a?.m.K;a=d?a:b;d??=b.o.K;gh(d,63);d(a,c)}function jh(a){var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push(...c.qa)}return b}
function kh(a){var b={zb:4096,Jb:4096,blocks:1E6,yc:5E5,xc:5E5,files:FS.Oa,Fc:FS.Oa-1,Kb:42,flags:2,Zb:255};a.o.ta&&Object.assign(b,a.o.ta(a.mount.Pa.root));return b}function lh(a,b,c,d){ih(a,b,{mode:c&4095|b.mode&-4096,ctime:Date.now(),Fa:d})}function mh(a,b,c){if(FS.isDir(b.mode))throw new FS.g(31);if(!FS.isFile(b.mode))throw new FS.g(28);var d=bh(b,"w");if(d)throw new FS.g(d);ih(a,b,{size:c,timestamp:Date.now()})}
function nh(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(d,e,f,g)=>g,llseek:()=>0});FS.mkdev("/dev/null",FS.makedev(1,3));Gg(FS.makedev(5,0),Ig);Gg(FS.makedev(6,0),Jg);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(Ag(a),b=a.byteLength);return a[--b]};FS.createDevice("/dev","random",c);FS.createDevice("/dev","urandom",c);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}
function oh(){FS.mkdir("/proc");var a=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var b=FS.createNode(a,"fd",16895,73);b.m={llseek:S.m.llseek};b.o={lookup(c,d){c=+d;var e=U(c);c={parent:null,mount:{kb:"fake"},o:{readlink:()=>e.path},id:c+1};return c.parent=c},readdir(){return Array.from(FS.streams.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},{},"/proc/self/fd")}
function ph(a,b,c,d){a=ug("string"==typeof a?a:FS.getPath(a),b);return FS.create(a,Pg(c,d))}function qh(a){if(!(a.Wb||a.Xb||a.link||a.v))if(globalThis.XMLHttpRequest)db("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{a.v=la(a.url)}catch(b){throw new FS.g(29);}}
var FS={root:null,qa:[],ab:{},streams:[],Oa:1,ea:null,Za:"/",Ia:!1,gb:!0,Ib:null,Ba:0,g:class{name="ErrnoError";constructor(a){this.A=a}},wb:class{V={};node=null;get object(){return this.node}set object(a){this.node=a}get flags(){return this.V.flags}set flags(a){this.V.flags=a}get position(){return this.V.position}set position(a){this.V.position=a}},vb:class{o={};m={};U=null;constructor(a,b,c,d){a||=this;this.parent=a;this.mount=a.mount;this.id=FS.Oa++;this.name=b;this.mode=c;this.rdev=d;this.atime=
this.mtime=this.ctime=Date.now()}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}get Xb(){return FS.isDir(this.mode)}get Wb(){return FS.isChrdev(this.mode)}},lookupPath(a,b={}){if(!a)throw new FS.g(44);b.xa??(b.xa=!0);pg(a)||(a=FS.cwd()+"/"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(h=>!!h);for(var d=FS.root,e="/",f=0;f<a.length;f++){var g=f===a.length-1;if(g&&b.parent)break;
if("."!==a[f])if(".."===a[f])if(e=rg(e),FS.pa(d)){a=e+"/"+a.slice(f+1).join("/");c--;continue a}else d=d.parent;else{e=ug(e,a[f]);try{d=Lg(d,a[f])}catch(h){if(44===h?.A&&g&&b.$b)return{path:e};throw h;}!d.U||g&&!b.xa||(d=d.U.root);if(FS.isLink(d.mode)&&(!g||b.follow)){if(!d.o.readlink)throw new FS.g(52);d=d.o.readlink(d);pg(d)||(d=rg(e)+"/"+d);a=d+"/"+a.slice(f+1).join("/");continue a}}}return{path:e,node:d}}throw new FS.g(32);},getPath(a){for(var b;;){if(FS.pa(a))return a=a.mount.kb,b?"/"!==a[a.length-
1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}},createNode(a,b,c,d){a=new FS.vb(a,b,c,d);dh(a);return a},pa(a){return a===a.parent},isFile(a){return 32768===(a&61440)},isDir(a){return 16384===(a&61440)},isLink(a){return 40960===(a&61440)},isChrdev(a){return 8192===(a&61440)},isBlkdev(a){return 24576===(a&61440)},isFIFO(a){return 4096===(a&61440)},isSocket(a){return 49152===(a&49152)},xb:4096,eb:a=>FS.streams[a],ia(a,b=-1){a=Object.assign(new FS.wb,a);if(-1==b)a:{for(b=0;b<=FS.xb;b++)if(!FS.streams[b])break a;
throw new FS.g(33);}a.fd=b;return FS.streams[b]=a},Ab:{open(a){a.m=FS.Mb(a.node.rdev).m;a.m.open?.(a)},llseek(){throw new FS.g(70);}},La:a=>a>>8,Hc:a=>a&255,makedev:(a,b)=>a<<8|b,registerDevice(a,b){FS.ab[a]={m:b}},Mb:a=>FS.ab[a],syncfs(a,b){function c(h){FS.Ba--;return b(h)}function d(h){if(h){if(!d.Gb)return d.Gb=!0,c(h)}else++f>=e.length&&c(null)}"function"==typeof a&&(b=a,a=!1);FS.Ba++;1<FS.Ba&&w(`warning: ${FS.Ba} FS.syncfs operations in flight at once, probably just doing extra work`);var e=
jh(FS.root.mount),f=0,g;for(g of e)g.type.syncfs?g.type.syncfs(g,a,d):d(null)},mount(a,b,c){var d="/"===c;if(d&&FS.root)throw new FS.g(10);if(!d&&c){var e=FS.lookupPath(c,{xa:!1});c=e.path;e=e.node;if(e.U)throw new FS.g(10);if(!FS.isDir(e.mode))throw new FS.g(54);}b={type:a,Pa:b,kb:c,qa:[]};a=a.mount(b);a.mount=b;b.root=a;d?FS.root=a:e&&(e.U=b,e.mount&&e.mount.qa.push(b));return a},unmount(a){a=FS.lookupPath(a,{xa:!1});if(!a.node.U)throw new FS.g(28);a=a.node;var b=a.U,c=jh(b);for([,e]of Object.entries(FS.ea))for(;e;){var d=
e.la;c.includes(e.mount)&&Mg(e);var e=d}a.U=null;a.mount.qa.splice(a.mount.qa.indexOf(b),1)},lookup(a,b){return a.o.lookup(a,b)},T(a,b,c){var d=FS.lookupPath(a,{parent:!0}).node;a=sg(a);if(!a)throw new FS.g(28);if("."===a||".."===a)throw new FS.g(20);var e=eh(d,a);if(e)throw new FS.g(e);if(!d.o.T)throw new FS.g(63);return d.o.T(d,a,b,c)},ta(a){return kh(FS.lookupPath(a,{follow:!0}).node)},rc(a){return kh(a.node)},create(a,b=438){return FS.T(a,b&4095|32768,0)},mkdir(a,b=511){return FS.T(a,b&1023|16384,
0)},Ic(a,b){var c=a.split("/"),d="",e;for(e of c)if(e){if(d||pg(a))d+="/";d+=e;try{FS.mkdir(d,b)}catch(f){if(20!=f.A)throw f;}}},mkdev(a,b,c){"undefined"==typeof c&&(c=b,b=438);return FS.T(a,b|8192,c)},symlink(a,b){if(!Bg(a))throw new FS.g(44);var c=FS.lookupPath(b,{parent:!0}).node;if(!c)throw new FS.g(44);b=sg(b);var d=eh(c,b);if(d)throw new FS.g(d);if(!c.o.symlink)throw new FS.g(63);return c.o.symlink(c,b,a)},rename(a,b){var c=rg(a),d=rg(b),e=sg(a),f=sg(b);var g=FS.lookupPath(a,{parent:!0});var h=
g.node;g=FS.lookupPath(b,{parent:!0});g=g.node;if(!h||!g)throw new FS.g(44);if(h.mount!==g.mount)throw new FS.g(75);var k=Lg(h,e);a=Cg(a,d);if("."!==a.charAt(0))throw new FS.g(28);a=Cg(b,c);if("."!==a.charAt(0))throw new FS.g(55);try{var l=Lg(g,f)}catch(m){}if(k!==l){b=FS.isDir(k.mode);if(e=fh(h,e,b))throw new FS.g(e);if(e=l?fh(g,f,b):eh(g,f))throw new FS.g(e);if(!h.o.rename)throw new FS.g(63);if(k.U||l&&l.U)throw new FS.g(10);if(g!==h&&(e=bh(h,"w")))throw new FS.g(e);Mg(k);try{h.o.rename(k,g,f),
k.parent=g}catch(m){throw m;}finally{dh(k)}}},rmdir(a){var b=FS.lookupPath(a,{parent:!0}).node;a=sg(a);var c=Lg(b,a),d=fh(b,a,!0);if(d)throw new FS.g(d);if(!b.o.rmdir)throw new FS.g(63);if(c.U)throw new FS.g(10);b.o.rmdir(b,a);Mg(c)},readdir(a){a=FS.lookupPath(a,{follow:!0}).node;return gh(a.o.readdir,54)(a)},unlink(a){var b=FS.lookupPath(a,{parent:!0}).node;if(!b)throw new FS.g(44);a=sg(a);var c=Lg(b,a),d=fh(b,a,!1);if(d)throw new FS.g(d);if(!b.o.unlink)throw new FS.g(63);if(c.U)throw new FS.g(10);
b.o.unlink(b,a);Mg(c)},readlink(a){a=FS.lookupPath(a).node;if(!a)throw new FS.g(44);if(!a.o.readlink)throw new FS.g(28);return a.o.readlink(a)},stat(a,b){a=FS.lookupPath(a,{follow:!b}).node;return gh(a.o.I,63)(a)},fstat(a){var b=U(a);a=b.node;var c=b.m.I;b=c?b:a;c??=a.o.I;gh(c,63);return c(b)},lstat(a){return FS.stat(a,!0)},chmod(a,b,c){a="string"==typeof a?FS.lookupPath(a,{follow:!c}).node:a;lh(null,a,b,c)},lchmod(a,b){FS.chmod(a,b,!0)},fchmod(a,b){a=U(a);lh(a,a.node,b,!1)},chown(a,b,c,d){a="string"==
typeof a?FS.lookupPath(a,{follow:!d}).node:a;ih(null,a,{timestamp:Date.now(),Fa:d})},lchown(a,b,c){FS.chown(a,b,c,!0)},fchown(a){a=U(a);ih(a,a.node,{timestamp:Date.now(),Fa:!1})},truncate(a,b){if(0>b)throw new FS.g(28);a="string"==typeof a?FS.lookupPath(a,{follow:!0}).node:a;mh(null,a,b)},ftruncate(a,b){a=U(a);if(0>b||0===(a.flags&2097155))throw new FS.g(28);mh(a,a.node,b)},utime(a,b,c){a=FS.lookupPath(a,{follow:!0}).node;gh(a.o.K,63)(a,{atime:b,mtime:c})},open(a,b,c=438){if(""===a)throw new FS.g(44);
b=Ng(b);c=b&64?c&4095|32768:0;if("object"==typeof a)var d=a;else{var e=a.endsWith("/");var f=FS.lookupPath(a,{follow:!(b&131072),$b:!0});d=f.node;a=f.path}f=!1;if(b&64)if(d){if(b&128)throw new FS.g(20);}else{if(e)throw new FS.g(31);d=FS.T(a,c|511,0);f=!0}if(!d)throw new FS.g(44);FS.isChrdev(d.mode)&&(b&=-513);if(b&65536&&!FS.isDir(d.mode))throw new FS.g(54);if(!f){e=d;a=b;if(e)if(FS.isLink(e.mode))e=32;else{var g=["r","w","rw"][a&3];a&512&&(g+="w");e=FS.isDir(e.mode)&&("r"!==g||a&576)?31:bh(e,g)}else e=
44;if(e)throw new FS.g(e);}b&512&&!f&&FS.truncate(d,0);b&=-131713;b=FS.ia({node:d,path:FS.getPath(d),flags:b,seekable:!0,position:0,m:d.m,tc:[],error:!1});b.m.open&&b.m.open(b);f&&FS.chmod(d,c&511);return b},close(a){if(null===a.fd)throw new FS.g(8);a.Ga&&(a.Ga=null);try{a.m.close&&a.m.close(a)}catch(b){throw b;}finally{FS.streams[a.fd]=null}a.fd=null},llseek(a,b,c){if(null===a.fd)throw new FS.g(8);if(!a.seekable||!a.m.llseek)throw new FS.g(70);if(0!=c&&1!=c&&2!=c)throw new FS.g(28);a.position=a.m.llseek(a,
b,c);a.tc=[];return a.position},read(a,b,c,d,e){if(0>d||0>e)throw new FS.g(28);if(null===a.fd)throw new FS.g(8);if(1===(a.flags&2097155))throw new FS.g(8);if(FS.isDir(a.node.mode))throw new FS.g(31);if(!a.m.read)throw new FS.g(28);var f="undefined"!=typeof e;if(!f)e=a.position;else if(!a.seekable)throw new FS.g(70);b=a.m.read(a,b,c,d,e);f||(a.position+=b);return b},write(a,b,c,d,e,f){if(0>d||0>e)throw new FS.g(28);if(null===a.fd)throw new FS.g(8);if(0===(a.flags&2097155))throw new FS.g(8);if(FS.isDir(a.node.mode))throw new FS.g(31);
if(!a.m.write)throw new FS.g(28);a.seekable&&a.flags&1024&&FS.llseek(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new FS.g(70);b=a.m.write(a,b,c,d,e,f);g||(a.position+=b);return b},X(a,b,c,d,e){if(0!==(d&2)&&0===(e&2)&&2!==(a.flags&2097155))throw new FS.g(2);if(1===(a.flags&2097155))throw new FS.g(2);if(!a.m.X)throw new FS.g(43);if(!b)throw new FS.g(28);return a.m.X(a,b,c,d,e)},da(a,b,c,d,e){return a.m.da?a.m.da(a,b,c,d,e):0},ya(a,b,c){if(!a.m.ya)throw new FS.g(59);
return a.m.ya(a,b,c)},readFile(a,b={}){b.flags=b.flags||0;b.encoding=b.encoding||"binary";"utf8"!==b.encoding&&"binary"!==b.encoding&&db(`Invalid encoding type "${b.encoding}"`);var c=FS.open(a,b.flags);a=FS.stat(a).size;var d=new Uint8Array(a);FS.read(c,d,0,a,0);"utf8"===b.encoding&&(d=Mf(d));FS.close(c);return d},writeFile(a,b,c={}){c.flags=c.flags||577;a=FS.open(a,c.flags,c.mode);b=Og(b);FS.write(a,b,0,b.byteLength,void 0,c.Ec);FS.close(a)},cwd:()=>FS.Za,chdir(a){a=FS.lookupPath(a,{follow:!0});
if(null===a.node)throw new FS.g(44);if(!FS.isDir(a.node.mode))throw new FS.g(54);var b=bh(a.node,"x");if(b)throw new FS.g(b);FS.Za=a.path},Ya(a,b,c){a?FS.createDevice("/dev","stdin",a):FS.symlink("/dev/tty","/dev/stdin");b?FS.createDevice("/dev","stdout",null,b):FS.symlink("/dev/tty","/dev/stdout");c?FS.createDevice("/dev","stderr",null,c):FS.symlink("/dev/tty1","/dev/stderr");FS.open("/dev/stdin",0);FS.open("/dev/stdout",1);FS.open("/dev/stderr",1)},Ua(){FS.ea=Array(4096);FS.mount(S,{},"/");FS.mkdir("/tmp");
FS.mkdir("/home");FS.mkdir("/home/web_user");nh();oh();FS.Ib={MEMFS:S,NODEFS}},init(a,b,c){FS.Ia=!0;a??=n.stdin;b??=n.stdout;c??=n.stderr;FS.Ya(a,b,c)},Gc(a,b){a=FS.analyzePath(a,b);return a.exists?a.object:null},analyzePath(a,b){try{var c=FS.lookupPath(a,{follow:!b});a=c.path}catch(e){}var d={pa:!1,exists:!1,error:0,name:null,path:null,object:null,ac:!1,dc:null,cc:null};try{c=FS.lookupPath(a,{parent:!0}),d.ac=!0,d.dc=c.path,d.cc=c.node,d.name=sg(a),c=FS.lookupPath(a,{follow:!b}),d.exists=!0,d.path=
c.path,d.object=c.node,d.name=c.node.name,d.pa="/"===c.path}catch(e){d.error=e.A}return d},createPath(a,b){a="string"==typeof a?a:FS.getPath(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var d=ug(a,c);try{FS.mkdir(d)}catch(e){if(20!=e.A)throw e;}a=d}}return d},createDataFile(a,b,c,d,e,f){var g=b;a&&(a="string"==typeof a?a:FS.getPath(a),g=b?ug(a,b):a);a=Pg(d,e);g=FS.create(g,a);c&&(c=Og(c),FS.chmod(g,a|146),b=FS.open(g,577),FS.write(b,c,0,c.length,0,f),FS.close(b),FS.chmod(g,a))},
createDevice(a,b,c,d){a=ug("string"==typeof a?a:FS.getPath(a),b);b=Pg(!!c,!!d);var e;(e=FS.createDevice).La??(e.La=64);e=FS.makedev(FS.createDevice.La++,0);FS.registerDevice(e,{open(f){f.seekable=!1},close(){d?.buffer?.length&&d(10)},read(f,g,h,k){for(var l=0,m=0;m<k;m++){try{var p=c()}catch(r){throw new FS.g(29);}if(void 0===p&&0===l)throw new FS.g(6);if(null===p||void 0===p)break;l++;g[h+m]=p}l&&(f.node.atime=Date.now());return l},write(f,g,h,k){for(var l=0;l<k;l++)try{d(g[h+l])}catch(m){throw new FS.g(29);
}k&&(f.node.mtime=f.node.ctime=Date.now());return l}});return FS.mkdev(a,b,e)},createLazyFile(a,b,c,d,e){function f(m,p,r,q,u){m=m.node.v;if(u>=m.length)return 0;q=Math.min(m.length-u,q);if(m.slice)for(var A=0;A<q;A++)p[r+A]=m[u+A];else for(A=0;A<q;A++)p[r+A]=m.get(u+A);return q}class g{Ha=!1;ka=[];oa=void 0;jb=0;ib=0;get(m){if(!(m>this.length-1||0>m)){var p=m%this.chunkSize;return this.oa(m/this.chunkSize|0)[p]}}jc(m){this.oa=m}lb(){var m=new XMLHttpRequest;m.open("HEAD",c,!1);m.send(null);200<=
m.status&&300>m.status||304===m.status||db("Couldn't load "+c+". Status: "+m.status);var p=Number(m.getResponseHeader("Content-length")),r,q=(r=m.getResponseHeader("Accept-Ranges"))&&"bytes"===r;m=(r=m.getResponseHeader("Content-Encoding"))&&"gzip"===r;var u=1048576;q||(u=p);var A=this;A.jc(G=>{var D=G*u,H=(G+1)*u-1;H=Math.min(H,p-1);if("undefined"==typeof A.ka[G]){var R=A.ka;D>H&&db("invalid range ("+D+", "+H+") or no bytes requested!");H>p-1&&db("only "+p+" bytes available! programmer error!");
var I=new XMLHttpRequest;I.open("GET",c,!1);p!==u&&I.setRequestHeader("Range","bytes="+D+"-"+H);I.responseType="arraybuffer";I.overrideMimeType&&I.overrideMimeType("text/plain; charset=x-user-defined");I.send(null);200<=I.status&&300>I.status||304===I.status||db("Couldn't load "+c+". Status: "+I.status);D=void 0!==I.response?new Uint8Array(I.response||[]):Eg(I.responseText||"");R[G]=D}"undefined"==typeof A.ka[G]&&db("doXHR failed!");return A.ka[G]});if(m||!p)u=p=1,u=p=this.oa(0).length,ra("LazyFiles on gzip forces download of the whole file when length is accessed");
this.jb=p;this.ib=u;this.Ha=!0}get length(){this.Ha||this.lb();return this.jb}get chunkSize(){this.Ha||this.lb();return this.ib}}if(globalThis.XMLHttpRequest){ba||db("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var h=new g;var k=void 0}else k=c,h=void 0;var l=ph(a,b,d,e);h?l.v=h:k&&(l.v=null,l.url=k);Object.defineProperties(l,{O:{get:function(){return this.v.length}}});a={};for(const [m,p]of Object.entries(l.m))a[m]=(...r)=>
{qh(l);return p(...r)};a.read=(m,p,r,q,u)=>{qh(l);return f(m,p,r,q,u)};a.X=(m,p,r)=>{qh(l);var q=Kg(p);if(!q)throw new FS.g(48);f(m,y,q,p,r);return{s:q,W:!0}};l.m=a;return l}},ig=(a,b)=>{if(Xa){if(pg(a))try{return FS.lookupPath(a),a}catch(d){return}var c=(b?.ec||[]).map(d=>{var e=b?.bc;d.startsWith("$ORIGIN")&&(e=rg(e),d=d.replace("$ORIGIN",e));return d});return vg(()=>{var d=df(512),e=yg(c.join(":")),f=yg(a);return(d=Ve(d,e,f,512))?Q(d):void 0})}};
function jg(a,b={global:!0,ra:!0},c,d){function e(){var k=Da[a];if(k)return b.J?Promise.resolve(k):k;if(d){k=F[d+28>>2];var l=F[d+32>>2];if(k&&l)return k=y.slice(k,k+l),b.J?Promise.resolve(k):k}if(k=ig(a,b.Ta))return k=FS.readFile(k,{encoding:"binary"}),b.J?Promise.resolve(k):k;k=ja(a);if(b.J)return lg(k);if(!la)throw Error(`${k}: file not found, and synchronous loading of external files is not available`);return la(k)}function f(){var k=ng[a];return k?b.J?Promise.resolve(k):k:b.J?e().then(l=>kg(l,
b,a,c,d)):kg(e(),b,a,c,d)}function g(k){h.global?Fe(k):c&&Object.assign(c,k);h.exports=k}var h=Of[a];if(h)return b.global?h.global||(h.global=!0,Fe(h.exports)):c&&Object.assign(c,h.exports),b.ra&&Infinity!==h.ma&&(h.ma=Infinity),h.ma++,d&&(Pf[d]=h),b.J?Promise.resolve(!0):!0;h=nf(a,d,"loading");h.ma=b.ra?Infinity:1;h.global=b.global;if(b.J)return f().then(k=>{g(k);return!0});g(f());return!0}
var hg=()=>{var a,b;for([a,b]of Object.entries(qf))if(-1==b.value){var c=fg(a).Va;if(c||b.required)if("function"==typeof c)b.value=Zf(c,c.h);else if("number"==typeof c)b.value=c;else if("number"==typeof c.value)b.value=c;else throw Error(`bad export type for '${a}': ${typeof c} (${c})`);else b.value=0}},of=async()=>{if(sa.length){Zg("loadDylibs");for(var a of sa)await jg(a,{J:!0,global:!0,ra:!0,yb:!0});hg();Yg("loadDylibs")}else hg()},Df=!1,He=(a,b,c)=>{function d(){var e=a();if(e){var f={};c.rb.forEach(g=>
f[g]=b[g]);mf($f(f,e),!0)}}Gf.push(d);Xa&&d()},Ha,kb=(a,b,c,d)=>db(`Assertion failed: ${Q(a)}, at: `+[b?Q(b):"unknown filename",c,d?Q(d):"unknown function"]);kb.h="vppip";var lb=(a,b)=>P(a)(b);lb.h="vpi";var rh=[],sh=0,mb=a=>{var b=new th(a);0==y[b.s+12]&&(y[b.s+12]=1,sh--);y[b.s+13]=0;rh.push(b);return jf(a)};mb.h="pp";var uh=0,nb=()=>{L(0,0);var a=rh.pop();ef(a.ga);uh=0};nb.h="v";class th{constructor(a){this.ga=a;this.s=a-24}init(a,b){F[this.s+16>>2]=0;F[this.s+4>>2]=a;F[this.s+8>>2]=b}}
var eg=a=>{var b=uh?.ga;if(!b)return bf(0),0;var c=new th(b);F[c.s+16>>2]=b;var d=F[c.s+4>>2];if(!d)return bf(0),b;for(var e of a){if(0===e||e===d)break;if(hf(e,d,c.s+16))return bf(e),b}bf(d);return b},ob=()=>eg([]);ob.h="p";var pb=a=>eg([a]);pb.h="pp";var qb=()=>{var a=rh.pop();a||db("no exception to throw");var b=a.ga;0==y[a.s+13]&&(rh.push(a),y[a.s+13]=1,y[a.s+12]=0,sh++);ff(b);uh=new ya(b);throw uh;};qb.h="v";var rb=(a,b,c)=>{(new th(a)).init(b,c);ff(a);uh=new ya(a);sh++;throw uh;};rb.h="vppp";
var sb=()=>sh;sb.h="i";function tb(...a){return K.__lsan_ignore_object(...a)}tb.L=!0;function vh(a,b,c,d){return v?O(2,1,a,b,c,d):ub(a,b,c,d)}var ub=(a,b,c,d)=>{if(!globalThis.SharedArrayBuffer)return 6;var e=[];if(v&&0===e.length)return vh(a,b,c,d);a={pc:c,Z:a,Da:d,sb:e};return v?(a.S="spawnThread",postMessage(a,e),0):Bf(a)};ub.h="ipppp";var vb=a=>{uh||=new ya(a);throw uh;};vb.h="vp";
function wh(a,b,c){if(pg(b))return b;a=-100===a?FS.cwd():U(a).path;if(0==b.length){if(!c)throw new FS.g(44);return a}return a+"/"+b}
function xh(a,b){F[a>>2]=b.dev;F[a+4>>2]=b.mode;F[a+8>>2]=b.nlink;F[a+12>>2]=b.uid;F[a+16>>2]=b.gid;F[a+20>>2]=b.rdev;J[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.blocks;var c=b.atime.getTime(),d=b.mtime.getTime(),e=b.ctime.getTime();J[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;J[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;J[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;J[a+88>>3]=BigInt(b.ino);return 0}var yh=void 0;
function wb(a){if(v)return O(3,1,a);try{var b=U(a);return hh(b).fd}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return-c.A}}wb.h="ii";function xb(a,b,c,d){if(v)return O(4,1,a,b,c,d);try{b=Q(b);b=wh(a,b);if(c&-8)return-28;var e=FS.lookupPath(b,{follow:!0}).node;if(!e)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&bh(e,a)?-2:0}catch(f){if("undefined"==typeof FS||"ErrnoError"!==f.name)throw f;return-f.A}}xb.h="iipii";var zh=()=>{var a=E[+yh>>2];yh+=4;return a};
function yb(a,b,c){if(v)return O(5,1,a,b,c);yh=c;try{var d=U(a);switch(b){case 0:var e=zh();if(0>e)break;for(;FS.streams[e];)e++;return hh(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=zh(),d.flags|=e,0;case 12:return e=zh(),B[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(f){if("undefined"==typeof FS||"ErrnoError"!==f.name)throw f;return-f.A}}yb.h="iiip";
function zb(a,b){if(v)return O(6,1,a,b);try{return xh(b,FS.fstat(a))}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return-c.A}}zb.h="iip";function Ab(a,b){if(v)return O(7,1,a,b);b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;FS.ftruncate(a,b);return 0}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return-c.A}}Ab.h="iij";
function Bb(a,b){if(v)return O(8,1,a,b);try{if(0===b)return-28;var c=FS.cwd(),d=wg(c)+1;if(b<d)return-68;xg(c,z,a,b);return d}catch(e){if("undefined"==typeof FS||"ErrnoError"!==e.name)throw e;return-e.A}}Bb.h="ipp";
function Cb(a,b,c){if(v)return O(9,1,a,b,c);yh=c;try{var d=U(a);switch(b){case 21509:return d.tty?0:-59;case 21505:if(!d.tty)return-59;if(d.tty.fa.Tb){a=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var e=zh();E[e>>2]=25856;E[e+4>>2]=5;E[e+8>>2]=191;E[e+12>>2]=35387;for(var f=0;32>f;f++)y[e+f+17]=a[f]||0}return 0;case 21510:case 21511:case 21512:return d.tty?0:-59;case 21506:case 21507:case 21508:if(!d.tty)return-59;if(d.tty.fa.Ub)for(e=zh(),a=[],f=0;32>f;f++)a.push(y[e+
f+17]);return 0;case 21519:if(!d.tty)return-59;e=zh();return E[e>>2]=0;case 21520:return d.tty?-28:-59;case 21537:case 21531:return e=zh(),FS.ya(d,b,e);case 21523:if(!d.tty)return-59;d.tty.fa.Vb&&(f=[24,80],e=zh(),B[e>>1]=f[0],B[e+2>>1]=f[1]);return 0;case 21524:return d.tty?0:-59;case 21515:return d.tty?0:-59;default:return-28}}catch(g){if("undefined"==typeof FS||"ErrnoError"!==g.name)throw g;return-g.A}}Cb.h="iiip";
function Db(a,b){if(v)return O(10,1,a,b);try{return a=Q(a),xh(b,FS.lstat(a))}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return-c.A}}Db.h="ipp";function Eb(a,b,c,d){if(v)return O(11,1,a,b,c,d);try{b=Q(b);var e=d&256;b=wh(a,b,d&4096);return xh(c,e?FS.lstat(b):FS.stat(b))}catch(f){if("undefined"==typeof FS||"ErrnoError"!==f.name)throw f;return-f.A}}Eb.h="iippi";
function Fb(a,b,c,d){if(v)return O(12,1,a,b,c,d);yh=d;try{b=Q(b);b=wh(a,b);var e=d?zh():0;return FS.open(b,c,e).fd}catch(f){if("undefined"==typeof FS||"ErrnoError"!==f.name)throw f;return-f.A}}Fb.h="iipip";
function Gb(a,b,c){if(v)return O(13,2,a,b,c);try{const u=If;var d,e=new Promise(D=>{d=D}),f=[],g=!1;function A(D){g||(g=!0,f.forEach(H=>H()),d(D))}function G(D,H){return R=>{g||(R&=B[H+4>>1]|24,B[H+6>>1]=R,A(1))}}if(u&&0<c){var h=setTimeout(()=>{A(0)},c);f.push(()=>clearTimeout(h))}for(var k=0,l=0;l<b;l++){var m=a+8*l,p=B[m+4>>1],r=32,q=FS.eb(E[m>>2]);q&&(q.m.mb?r=u&&c?q.m.mb(q,c,G(q,m)):q.m.mb(q,-1):r=5);(r&=p|24)&&k++;B[m+6>>1]=r}return u?(!k&&c||A(k),e):k}catch(u){if("undefined"==typeof FS||"ErrnoError"!==
u.name)throw u;return-u.A}}Gb.h="ipii";function Hb(a){if(v)return O(14,1,a);try{return a=Q(a),FS.rmdir(a),0}catch(b){if("undefined"==typeof FS||"ErrnoError"!==b.name)throw b;return-b.A}}Hb.h="ip";function Ib(a,b){if(v)return O(15,1,a,b);try{return a=Q(a),xh(b,FS.stat(a))}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return-c.A}}Ib.h="ipp";
function Lb(a,b,c){if(v)return O(16,1,a,b,c);try{b=Q(b);b=wh(a,b);if(c)if(512===c)FS.rmdir(b);else return-28;else FS.unlink(b);return 0}catch(d){if("undefined"==typeof FS||"ErrnoError"!==d.name)throw d;return-d.A}}Lb.h="iipi";var Mb=()=>db("");Mb.h="v";
var Ah=a=>{var b=N();a=yg(a);Qe(a,0);M(b)},Bh=(a,b)=>{var c=Q(a+36),d=E[a+4>>2];c=qg(c);var e=!!(d&256),f=e?null:{};d={global:e,ra:!!(d&4096),J:b.J};if(b.J)return jg(c,d,f,a);try{return jg(c,d,f,a)}catch(g){return Ah(`could not load dynamic lib: ${c}\n${g}`),0}},Nb=a=>Bh(a,{J:!1});Nb.h="pp";var Ob=(a,b)=>{a=Pf[a].exports;b=Object.keys(a)[b];b=a[b];return Zf(b,b.h)};Ob.h="ppi";
var Pb=(a,b,c)=>{b=Q(b);var d=Pf[a];a=Object.keys(d.exports).indexOf(b);if(-1==a||d.exports[b].L)return Ah(`Tried to lookup unknown symbol "${b}" in dynamic lib: ${d.name}`),0;b=d.exports[b];"function"==typeof b&&((d=Uf(b))?b=d:(b=Zf(b,b.h),F[c>>2]=a));return b};Pb.h="pppp";var Ch={},Dh=a=>{for(;a.length;){var b=a.pop();a.pop()(b)}};function Eh(a){return this.B(F[a>>2])}
var Fh={},Gh={},Hh={},Ih=class extends Error{constructor(a){super(a);this.name="InternalError"}},Jh=(a,b,c)=>{function d(h){h=c(h);if(h.length!==a.length)throw new Ih("Mismatched type converter count");for(var k=0;k<a.length;++k)V(a[k],h[k])}a.forEach(h=>Hh[h]=b);var e=Array(b.length),f=[],g=0;for(let [h,k]of b.entries())Gh.hasOwnProperty(k)?e[h]=Gh[k]:(f.push(k),Fh.hasOwnProperty(k)||(Fh[k]=[]),Fh[k].push(()=>{e[h]=Gh[k];++g;g===f.length&&d(e)}));0===f.length&&d(e)},Qb=a=>{var b=Ch[a];delete Ch[a];
var c=b.Ra,d=b.$,e=b.bb,f=e.map(g=>g.Pb).concat(e.map(g=>g.lc));Jh([a],f,g=>{var h={},k,l;for([k,l]of e.entries()){const m=g[k],p=l.oa,r=l.Ob,q=g[k+e.length],u=l.kc,A=l.mc;h[l.Hb]={read:G=>m.B(p(r,G)),write:(G,D)=>{var H=[];u(A,G,q.F(H,D));Dh(H)},optional:m.optional}}return[{name:b.name,B:m=>{var p={},r;for(r in h)p[r]=h[r].read(m);d(m);return p},F:(m,p)=>{for(var r in h)if(!(r in p||h[r].optional))throw new TypeError(`Missing field: "${r}"`);var q=c();for(r in h)h[r].write(q,p[r]);null!==m&&m.push(d,
q);return q},N:Eh,H:d}]})};Qb.h="vp";var W=a=>{for(var b="";;){var c=z[a++];if(!c)return b;b+=String.fromCharCode(c)}},X=class extends Error{constructor(a){super(a);this.name="BindingError"}},Kh=a=>{throw new X(a);};
function Lh(a,b,c={}){var d=b.name;if(!a)throw new X(`type "${d}" must have a positive integer typeid pointer`);if(Gh.hasOwnProperty(a)){if(c.Sb)return;throw new X(`Cannot register type '${d}' twice`);}Gh[a]=b;delete Hh[a];Fh.hasOwnProperty(a)&&(b=Fh[a],delete Fh[a],b.forEach(e=>e()))}function V(a,b,c={}){return Lh(a,b,c)}
var Rb=(a,b,c,d,e)=>{b=W(b);if(d)a:switch(c){case 4:d=Ua;break a;case 8:d=Va;break a;default:throw new TypeError(`invalid float width (${c}): ${b}`);}else a:switch(c){case 1:d=e?y:z;break a;case 2:d=e?B:C;break a;case 4:d=e?E:F;break a;case 8:d=e?J:Wa;break a;default:throw new TypeError(`invalid integer width (${c}): ${b}`);}var f=d,g=Math.log2(c);V(a,{name:b,B:h=>{var k=h+Math.max(4,c)>>g;k=Array.from(f.subarray(k,k+F[h>>2]));Ke(h);return k},F:(h,k)=>{"number"==typeof k&&(k=[k]);if(!Array.isArray(k))throw new X(`Cannot pass non-array to C++ vector type ${b}`);
k=Array.prototype.concat.apply([],k);var l=k.length,m=Math.max(4,c),p=Je(m+l*c);m=p+m>>g;F[p>>2]=l;f.set(k,m);null!==h&&h.push(Ke,p);return p},N:Eh,H(h){Ke(h)}})};Rb.h="vpppii";
var Mh=(a,b,c)=>{switch(b){case 1:return c?d=>y[d]:d=>z[d];case 2:return c?d=>B[d>>1]:d=>C[d>>1];case 4:return c?d=>E[d>>2]:d=>F[d>>2];case 8:return c?d=>J[d>>3]:d=>Wa[d>>3];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},Sb=(a,b,c,d,e)=>{b=W(b);d=0n===d;let f=g=>g;if(d){const g=8*c;f=h=>BigInt.asUintN(g,h);e=f(e)}V(a,{name:b,B:f,F:(g,h)=>{"number"==typeof h&&(h=BigInt(h));return h},N:Mh(b,c,!d),H:null})};Sb.h="vpppjj";
var Tb=(a,b,c,d)=>{b=W(b);V(a,{name:b,B:function(e){return!!e},F:function(e,f){return f?c:d},N:function(e){return this.B(z[e])},H:null})};Tb.h="vppii";
var Nh=a=>{throw new X(a.l.C.u.name+" instance already deleted");},Oh=!1,Ph=!1,Qh=()=>{},Rh=a=>{if(Oh)return Rh=b=>b.deleteLater(),Rh(a);if(!globalThis.FinalizationRegistry)return Rh=b=>b,a;Ph=new FinalizationRegistry(b=>{b=b.l;--b.count.value;0===b.count.value&&(b.M?b.R.$(b.M):b.C.u.$(b.s))});Rh=b=>{var c=b.l;c.M&&Ph.register(b,{l:c},b);return b};Qh=b=>{Ph.unregister(b)};return Rh(a)},Sh=[],Th=()=>{for(;Sh.length;){var a=Sh.pop();a.l.ja=!1;a["delete"]()}},Uh;function Vh(){}
var Wh={},Xh=(a,b,c)=>{if(void 0===a[b].G){var d=a[b];a[b]=function(...e){if(!a[b].G.hasOwnProperty(e.length))throw new X(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${a[b].G})!`);return a[b].G[e.length].apply(this,e)};a[b].G=[];a[b].G[d.aa]=d}},Yh=(a,b,c)=>{if(n.hasOwnProperty(a)){if(void 0===c||void 0!==n[a].G&&void 0!==n[a].G[c])throw new X(`Cannot register public name '${a}' twice`);Xh(n,a,a);if(n[a].G.hasOwnProperty(c))throw new X(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
n[a].G[c]=b}else n[a]=b,n[a].aa=c},Zh=a=>{a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?`_${a}`:a};function $h(a,b,c,d,e,f,g,h){this.name=a;this.constructor=b;this.ba=c;this.$=d;this.P=e;this.Lb=f;this.va=g;this.Cb=h;this.hc=[]}
var ai=(a,b,c)=>{for(;b!==c;){if(!b.va)throw new X(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);a=b.va(a);b=b.P}return a},bi=a=>{if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a};
function ci(a,b){if(null===b){if(this.Ja)throw new X(`null is not a valid ${this.name}`);return 0}if(!b.l)throw new X(`Cannot pass "${bi(b)}" as a ${this.name}`);if(!b.l.s)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);return ai(b.l.s,b.l.C.u,this.u)}
function di(a,b){if(null===b){if(this.Ja)throw new X(`null is not a valid ${this.name}`);if(this.Aa){var c=this.Ra();null!==a&&a.push(this.$,c);return c}return 0}if(!b||!b.l)throw new X(`Cannot pass "${bi(b)}" as a ${this.name}`);if(!b.l.s)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.za&&b.l.C.za)throw new X(`Cannot convert argument of type ${b.l.R?b.l.R.name:b.l.C.name} to parameter type ${this.name}`);c=ai(b.l.s,b.l.C.u,this.u);if(this.Aa){if(void 0===b.l.M)throw new X("Passing raw pointer to smart pointer is illegal");
switch(this.oc){case 0:if(b.l.R===this)c=b.l.M;else throw new X(`Cannot convert argument of type ${b.l.R?b.l.R.name:b.l.C.name} to parameter type ${this.name}`);break;case 1:c=b.l.M;break;case 2:if(b.l.R===this)c=b.l.M;else{var d=b.clone();c=this.ic(c,ei(()=>d["delete"]()));null!==a&&a.push(this.$,c)}break;default:throw new X("Unsupported sharing policy");}}return c}
function fi(a,b){if(null===b){if(this.Ja)throw new X(`null is not a valid ${this.name}`);return 0}if(!b.l)throw new X(`Cannot pass "${bi(b)}" as a ${this.name}`);if(!b.l.s)throw new X(`Cannot pass deleted object as a pointer of type ${this.name}`);if(b.l.C.za)throw new X(`Cannot convert argument of type ${b.l.C.name} to parameter type ${this.name}`);return ai(b.l.s,b.l.C.u,this.u)}
var gi=(a,b,c)=>{if(b===c)return a;if(void 0===c.P)return null;a=gi(a,b,c.P);return null===a?null:c.Cb(a)},hi={},ii=(a,b)=>{if(void 0===b)throw new X("ptr should not be undefined");for(;a.P;)b=a.va(b),a=a.P;return hi[b]},ji=(a,b)=>{if(!b.C||!b.s)throw new Ih("makeClassHandle requires ptr and ptrType");if(!!b.R!==!!b.M)throw new Ih("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Rh(Object.create(a,{l:{value:b,writable:!0}}))};
function ki(a,b,c,d,e,f,g,h,k,l,m){this.name=a;this.u=b;this.Ja=c;this.za=d;this.Aa=e;this.fc=f;this.oc=g;this.ob=h;this.Ra=k;this.ic=l;this.$=m;e||void 0!==b.P?this.F=di:(this.F=d?ci:fi,this.H=null)}var li=(a,b,c)=>{if(!n.hasOwnProperty(a))throw new Ih("Replacing nonexistent public symbol");void 0!==n[a].G&&void 0!==c?n[a].G[c]=b:(n[a]=b,n[a].aa=c)},Y=(a,b)=>{a=W(a);var c=P(b);if("function"!=typeof c)throw new X(`unknown function pointer with signature ${a}: ${b}`);return c};
class mi extends Error{}
var ni=a=>{a=Ne(a);var b=W(a);Ke(a);return b},oi=(a,b)=>{function c(f){e[f]||Gh[f]||(Hh[f]?Hh[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};b.forEach(c);throw new mi(`${a}: `+d.map(ni).join([", "]));},Ub=(a,b,c,d,e,f,g,h,k,l,m,p,r)=>{m=W(m);f=Y(e,f);h&&=Y(g,h);l&&=Y(k,l);r=Y(p,r);var q=Zh(m);Yh(q,function(){oi(`Cannot construct ${m} due to unbound types`,[d])});Jh([a,b,c],d?[d]:[],u=>{u=u[0];if(d){var A=u.u;var G=A.ba}else G=Vh.prototype;u=bg(m,function(...I){if(Object.getPrototypeOf(this)!==D)throw new X(`Use 'new' to construct ${m}`);
if(void 0===H.ha)throw new X(`${m} has no accessible constructor`);var Ra=H.ha[I.length];if(void 0===Ra)throw new X(`Tried to invoke ctor of ${m} with invalid number of parameters (${I.length}) - expected (${Object.keys(H.ha).toString()}) parameters instead!`);return Ra.apply(this,I)});var D=Object.create(G,{constructor:{value:u}});u.prototype=D;var H=new $h(m,u,D,r,A,f,h,l);if(H.P){var R;(R=H.P).wa??(R.wa=[]);H.P.wa.push(H)}A=new ki(m,H,!0,!1,!1);R=new ki(m+"*",H,!1,!1,!1);G=new ki(m+" const*",H,
!1,!0,!1);Wh[a]={pointerType:R,Bb:G};li(q,u);return[A,R,G]})};Ub.h="vppppppppppppp";function pi(a){for(var b=1;b<a.length;++b)if(null!==a[b]&&void 0===a[b].H)return!0;return!1}
function qi(a,b,c,d,e,f){var g=b.length;if(2>g)throw new X("argTypes array size mismatch! Must at least get return value and 'this' types!");var h=null!==b[1]&&null!==c,k=pi(b);c=!b[0].hb;var l=b[0],m=b[1];d=[a,Kh,d,e,Dh,l.B.bind(l),m?.F.bind(m)];for(e=2;e<g;++e)l=b[e],d.push(l.F.bind(l));if(!k)for(e=h?1:2;e<b.length;++e)null!==b[e].H&&d.push(b[e].H);k=pi(b);e=b.length-2;m=[];l=["fn"];h&&l.push("thisWired");for(g=0;g<e;++g)m.push(`arg${g}`),l.push(`arg${g}Wired`);m=m.join(",");l=l.join(",");m=`return function (${m}) {\n`;
k&&(m+="var destructors = [];\n");var p=k?"destructors":"null",r="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");h&&(m+=`var thisWired = toClassParamWire(${p}, this);\n`);for(g=0;g<e;++g){var q=`toArg${g}Wire`;m+=`var arg${g}Wired = ${q}(${p}, arg${g});\n`;r.push(q)}m+=(c||f?"var rv = ":"")+`invoker(${l});\n`;if(k)m+="runDestructors(destructors);\n";else for(g=h?1:2;g<b.length;++g)f=1===g?"thisWired":"arg"+(g-2)+"Wired",null!==b[g].H&&(m+=`${f}_dtor(${f});\n`,
r.push(`${f}_dtor`));c&&(m+="var ret = fromRetWire(rv);\nreturn ret;\n");b=(new Function(r,m+"}\n"))(...d);return bg(a,b)}
var ui=(a,b)=>{for(var c=[],d=0;d<a;d++)c.push(F[b+4*d>>2]);return c},vi=a=>{a=a.trim();const b=a.indexOf("(");return-1===b?a:a.slice(0,b)},Vb=(a,b,c,d,e,f,g,h)=>{var k=ui(c,d);b=W(b);b=vi(b);f=Y(e,f);Jh([],[a],l=>{function m(){oi(`Cannot call ${p} due to unbound types`,k)}l=l[0];var p=`${l.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var r=l.u.constructor;void 0===r[b]?(m.aa=c-1,r[b]=m):(Xh(r,b,p),r[b].G[c-1]=m);Jh([],k,q=>{q=[q[0],null].concat(q.slice(1));q=qi(p,q,null,f,g,h);void 0===
r[b].G?(q.aa=c-1,r[b]=q):r[b].G[c-1]=q;if(l.u.wa)for(const u of l.u.wa)u.constructor.hasOwnProperty(b)||(u.constructor[b]=q);return[]});return[]})};Vb.h="vppippppii";
var Wb=(a,b,c,d,e,f)=>{var g=ui(b,c);e=Y(d,e);Jh([],[a],h=>{h=h[0];var k=`constructor ${h.name}`;void 0===h.u.ha&&(h.u.ha=[]);if(void 0!==h.u.ha[b-1])throw new X(`Cannot register multiple constructors with identical number of parameters (${b-1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.u.ha[b-1]=()=>{oi(`Cannot construct ${h.name} due to unbound types`,g)};Jh([],g,l=>{l.splice(1,0,null);h.u.ha[b-1]=qi(k,l,null,e,f);
return[]});return[]})};Wb.h="vpipppp";
var Xb=(a,b,c,d,e,f,g,h,k)=>{var l=ui(c,d);b=W(b);b=vi(b);f=Y(e,f);Jh([],[a],m=>{function p(){oi(`Cannot call ${r} due to unbound types`,l)}m=m[0];var r=`${m.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);h&&m.u.hc.push(b);var q=m.u.ba,u=q[b];void 0===u||void 0===u.G&&u.className!==m.name&&u.aa===c-2?(p.aa=c-2,p.className=m.name,q[b]=p):(Xh(q,b,r),q[b].G[c-2]=p);Jh([],l,A=>{A=qi(r,A,m,f,g,k);void 0===q[b].G?(A.aa=c-2,q[b]=A):q[b].G[c-2]=A;return[]});return[]})};Xb.h="vppippppiii";
var wi=(a,b,c)=>{if(!(a instanceof Object))throw new X(`${c} with invalid "this": ${a}`);if(!(a instanceof b.u.constructor))throw new X(`${c} incompatible with "this" of type ${a.constructor.name}`);if(!a.l.s)throw new X(`cannot call emscripten binding method ${c} on deleted object`);return ai(a.l.s,a.l.C.u,b.u)},Yb=(a,b,c,d,e,f,g,h,k,l)=>{b=W(b);e=Y(d,e);Jh([],[a],m=>{m=m[0];var p=`${m.name}.${b}`,r={get(){oi(`Cannot access ${p} due to unbound types`,[c,g])},enumerable:!0,configurable:!0};r.set=
k?()=>oi(`Cannot access ${p} due to unbound types`,[c,g]):()=>{throw new X(p+" is a read-only property");};Object.defineProperty(m.u.ba,b,r);Jh([],k?[c,g]:[c],q=>{var u=q[0],A={get(){var D=wi(this,m,p+" getter");return u.B(e(f,D))},enumerable:!0};if(k){k=Y(h,k);var G=q[1];A.set=function(D){var H=wi(this,m,p+" setter"),R=[];k(l,H,G.F(R,D));Dh(R)}}Object.defineProperty(m.u.ba,b,A);return[]});return[]})};Yb.h="vpppppppppp";
var xi=[],yi=[0,1,,1,null,1,!0,1,!1,1],zc=a=>{9<a&&0===--yi[a+1]&&(yi[a]=void 0,xi.push(a))};zc.h="vp";var Z=a=>{if(!a)throw new X(`Cannot use deleted val. handle = ${a}`);return yi[a]},ei=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=xi.pop()||yi.length;yi[b]=a;yi[b+1]=1;return b}},zi={name:"emscripten::val",B:a=>{var b=Z(a);zc(a);return b},F:(a,b)=>ei(b),N:Eh,H:null},Zb=a=>V(a,zi);Zb.h="vp";
var Ai=(a,b,c)=>{switch(b){case 1:return c?function(d){return this.B(y[d])}:function(d){return this.B(z[d])};case 2:return c?function(d){return this.B(B[d>>1])}:function(d){return this.B(C[d>>1])};case 4:return c?function(d){return this.B(E[d>>2])}:function(d){return this.B(F[d>>2])};default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},$b=(a,b,c,d,e)=>{b=W(b);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function g(){}g.values={};V(a,{name:b,constructor:g,valueType:e,
B:function(h){return this.constructor.values[h]},F:(h,k)=>k.value,N:Ai(b,c,d),H:null});Yh(b,g);break;case "number":var f={};V(a,{name:b,Ka:f,valueType:e,B:h=>h,F:(h,k)=>k,N:Ai(b,c,d),H:null});Yh(b,f);delete n[b].aa;break;case "string":f={},V(a,{name:b,tb:{},pb:{},Ka:f,valueType:e,B:function(h){return this.pb[h]},F:function(h,k){return this.tb[k]},N:Ai(b,c,d),H:null}),Yh(b,f),delete n[b].aa}};$b.h="vpppii";
var Bi=(a,b)=>{var c=Gh[a];if(void 0===c)throw a=`${b} has unknown type ${ni(a)}`,new X(a);return c},ac=(a,b,c)=>{var d=Bi(a,"enum");b=W(b);switch(d.valueType){case "object":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:bg(`${d.name}_${b}`,function(){})}});a.values[c]=d;a[b]=d;break;case "number":d.Ka[b]=c;break;case "string":d.tb[b]=c,d.pb[c]=b,d.Ka[b]=b}};ac.h="vppi";
var Ci=(a,b)=>{switch(b){case 4:return function(c){return this.B(Ua[c>>2])};case 8:return function(c){return this.B(Va[c>>3])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}},bc=(a,b,c)=>{b=W(b);V(a,{name:b,B:d=>d,F:(d,e)=>e,N:Ci(b,c),H:null})};bc.h="vppp";var cc=(a,b,c,d,e,f,g)=>{var h=ui(b,c);a=W(a);a=vi(a);e=Y(d,e);Yh(a,function(){oi(`Cannot call ${a} due to unbound types`,h)},b-1);Jh([],h,k=>{k=[k[0],null].concat(k.slice(1));li(a,qi(a,k,null,e,f,g),b-1);return[]})};cc.h="vpippppii";
var dc=(a,b,c,d,e)=>{b=W(b);let f=h=>h;if(0===d){var g=32-8*c;f=h=>h<<g>>>g;e=f(e)}V(a,{name:b,B:f,F:(h,k)=>k,N:Mh(b,c,0!==d),H:null})};dc.h="vpppii";var Di=(a,b,c)=>{const d=(e,f)=>{let g=0;return{next(){if(g>=e)return{done:!0};const h=g;g++;return{value:f(h),done:!1}},[Symbol.iterator](){return this}}};a[Symbol.iterator]||(a[Symbol.iterator]=function(){const e=this[b]();return d(e,f=>this[c](f))})},ec=(a,b,c,d)=>{c=W(c);d=W(d);Jh([],[a,b],e=>{Di(e[0].u.ba,c,d);return[]})};ec.h="vpppp";
var fc=(a,b,c)=>{function d(f){return new e(y.buffer,F[f+4>>2],F[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=W(c);V(a,{name:c,B:d,N:d},{Sb:!0})};fc.h="vpip";var Ei=Object.assign({optional:!0},zi),gc=a=>{V(a,Ei)};gc.h="vpp";
var hc=(a,b)=>{b=W(b);V(a,{name:b,B(c){var d=Q(c+4,F[c>>2],!0);Ke(c);return d},F(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new X("Cannot pass non-string to std::string");var f=e?wg(d):d.length;var g=Je(4+f+1),h=g+4;F[g>>2]=f;e?xg(d,z,h,f+1):z.set(d,h);null!==c&&c.push(Ke,g);return g},N:Eh,H(c){Ke(c)}})};hc.h="vpp";
var Fi=new TextDecoder("utf-16le"),Gi=(a,b,c)=>{a>>=1;return Fi.decode(C.slice(a,Lf(C,a,b/2,c)))},Hi=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e<c;++e)B[b>>1]=a.charCodeAt(e),b+=2;B[b>>1]=0;return b-d},Ii=a=>2*a.length,Ji=(a,b,c)=>{var d="";a>>=2;for(var e=0;!(e>=b/4);e++){var f=F[a+e];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},Ki=(a,b,c)=>{c??=2147483647;if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e<a.length;++e){var f=a.codePointAt(e);
65535<f&&e++;E[b>>2]=f;b+=4;if(b+4>c)break}E[b>>2]=0;return b-d},Li=a=>{for(var b=0,c=0;c<a.length;++c)65535<a.codePointAt(c)&&c++,b+=4;return b},ic=(a,b,c)=>{c=W(c);if(2===b){var d=Gi;var e=Hi;var f=Ii}else d=Ji,e=Ki,f=Li;V(a,{name:c,B:g=>{var h=d(g+4,F[g>>2]*b,!0);Ke(g);return h},F:(g,h)=>{if("string"!=typeof h)throw new X(`Cannot pass non-string to C++ string type ${c}`);var k=f(h),l=Je(4+k+b);F[l>>2]=k/b;e(h,l+4,k+b);null!==g&&g.push(Ke,l);return l},N:Eh,H(g){Ke(g)}})};ic.h="vppp";
var jc=(a,b,c,d,e,f)=>{Ch[a]={name:W(b),Ra:Y(c,d),$:Y(e,f),bb:[]}};jc.h="vpppppp";var kc=(a,b,c,d,e,f,g,h,k,l)=>{Ch[a].bb.push({Hb:W(b),Pb:c,oa:Y(d,e),Ob:f,lc:g,kc:Y(h,k),mc:l})};kc.h="vpppppppppp";var lc=(a,b)=>{b=W(b);V(a,{hb:!0,name:b,B:()=>{},F:()=>{}})};lc.h="vpp";
var Mi=a=>{a instanceof pf||"unwind"==a||fa(1,a)},Hf=a=>{if(!Ya&&!va)try{return a()}catch(b){Mi(b)}finally{if(!(Ya||Df||0<Cf))try{v?Ie()&&Ze(wa):dd(wa)}catch(b){Mi(b)}}},mc=(a,b,c,d)=>{function e(h){var k=Q(a+36);Ah(`'Could not load dynamic lib: ${k}\n${h}`);--Cf;Hf(()=>P(c)(a,d))}function f(){--Cf;Hf(()=>P(b)(a,d))}Cf+=1;var g=Bh(a,{J:!0});g?g.then(f,e):e()};mc.h="vpppp";function Ni(a){var b=Oi,c=b.ka.pop()||b.W.length;b.W[c]=a;return c}function Pi(a){var b=Oi;b.W[a]=void 0;b.ka.push(a)}
class Qi{W=[void 0];ka=[];get(a){return this.W[a]}has(a){return void 0!==this.W[a]}}var Oi=new Qi,Ri=()=>{var a={};a.promise=new Promise((b,c)=>{a.reject=c;a.resolve=b});a.id=Ni(a);return a},Si=async()=>{const a=If,b=[];var c=Ri();b.push(c.promise);Re(c.id);for(const d of Object.keys(sf)){const e=Number(d);e===a||tf.has(e)||(c=Ri(),Te(e,c.id),uf[e]=c,b.push(c.promise))}await Promise.all(b);uf={}};
function nc(){if(v)return O(17,2);if(If)return Si();for(const a of Object.keys(sf)){const b=Number(a);tf.has(b)||Ue(b)}}nc.h="v";function oc(){var a=Je(4*(sa.length+1)),b=a;sa.forEach(c=>{var d=F,e=b>>2,f=wg(c)+1,g=Je(f);g&&xg(c,z,g,f);d[e]=g;b+=4});F[b>>2]=0;return a}oc.h="p";var pc=a=>{Ma(a,!ba,1,!aa,262144,!1);Na()};pc.h="vp";
var Ti=!Atomics.waitAsync||globalThis.Deno||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]),Oa=a=>{Ti||(Atomics.waitAsync(E,a>>2,a).value.then(Sa),Atomics.store(E,a+128>>2,1))};Oa.h="vp";var Sa=()=>Hf(()=>{var a=Ie();a&&(Oa(a),$e())}),qc=(a,b)=>{a==b?setTimeout(Sa):v?postMessage({Ca:a,S:"checkMailbox"}):(a=sf[a])&&a.postMessage({S:"checkMailbox"})};qc.h="vpp";
var Ui=[],rc=(a,b,c,d,e,f,g)=>{Ui.length=0;var h=e>>3;for(d=e+d>>3;h<d;){var k;J[h++]?k=J[h++]:k=Va[h++];Ui.push(k)}a=b?gg[b]:Vi[a];If=c;c=a(...Ui);If=0;if(f)c.then(l=>We(f,g,l));else return c};rc.h="dippippp";var sc=()=>{Df=!1;Cf=0};sc.h="v";var tc=a=>{v?postMessage({S:"cleanupThread",Wa:a}):xf(a)};tc.h="vp";var uc=a=>{v?postMessage({S:"markAsFinished",Wa:a}):zf(a)};uc.h="vp";var vc=a=>{t&&sf[a].ref()};vc.h="vp";var wc=()=>{throw new xa;};wc.h="v";var xc=(a,b)=>{a=Z(a);b=Z(b);a.set(b)};xc.h="vpp";
var Wi=[],Xi=a=>{var b=Wi.length;Wi.push(a);return b},Yi=(a,b)=>{for(var c=Array(a),d=0;d<a;++d)c[d]=Bi(F[b+4*d>>2],`parameter ${d}`);return c},Zi=(a,b,c)=>{var d=[];a=a(d,c);d.length&&(F[b>>2]=ei(d));return a},$i={},aj=a=>{var b=$i[a];return void 0===b?W(a):b},yc=(a,b,c)=>{var [d,...e]=Yi(a,b);b=d.F.bind(d);var f=e.map(k=>k.N.bind(k));a--;var g={toValue:Z};a=f.map((k,l)=>{var m=`argFromPtr${l}`;g[m]=k;return`${m}(args${l?"+"+8*l:""})`});switch(c){case 0:var h="toValue(handle)";break;case 2:h="new (toValue(handle))";
break;case 3:h="";break;case 1:g.getStringOrSymbol=aj,h="toValue(handle)[getStringOrSymbol(methodName)]"}h+=`(${a})`;d.hb||(g.toReturnWire=b,g.emval_returnValue=Zi,h=`return emval_returnValue(toReturnWire, destructorsRef, ${h})`);h=`return function (handle, methodName, destructorsRef, args) {\n${h}\n}`;c=(new Function(Object.keys(g),h))(...Object.values(g));h=`methodCaller<(${e.map(k=>k.name)}) => ${d.name}>`;return Xi(bg(h,c))};yc.h="pipi";var Ac=a=>{if(!a)return ei(globalThis);a=aj(a);return ei(globalThis[a])};
Ac.h="pp";var Bc=a=>{a=aj(a);return ei(n[a])};Bc.h="pp";var Cc=(a,b)=>{a=Z(a);b=Z(b);return ei(a[b])};Cc.h="ppp";var Dc=a=>{9<a&&(yi[a+1]+=1)};Dc.h="vp";var Ec=(a,b)=>{a=Z(a);b=Z(b);return a instanceof b};Ec.h="ipp";var Fc=(a,b,c,d,e)=>Wi[a](b,c,d,e);Fc.h="dppppp";var Gc=a=>{a=Z(a);return"number"==typeof a};Gc.h="ip";var Hc=a=>{a=Z(a);return"string"==typeof a};Hc.h="ip";var Ic=a=>ei(aj(a));Ic.h="pp";var Jc=a=>{var b=Z(a);Dh(b);zc(a)};Jc.h="vp";var Kc=(a,b,c)=>{a=Z(a);b=Z(b);c=Z(c);a[b]=c};Kc.h="vppp";
var Lc=a=>{a=Z(a);return ei(typeof a)};Lc.h="pp";function Mc(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getUTCSeconds();E[b+4>>2]=a.getUTCMinutes();E[b+8>>2]=a.getUTCHours();E[b+12>>2]=a.getUTCDate();E[b+16>>2]=a.getUTCMonth();E[b+20>>2]=a.getUTCFullYear()-1900;E[b+24>>2]=a.getUTCDay();E[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0}Mc.h="vjp";
var bj=[0,31,60,91,121,152,182,213,244,274,305,335],cj=[0,31,59,90,120,151,181,212,243,273,304,334];
function Nc(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?cj:bj)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0}Nc.h="vjp";function Oc(a,b,c,d,e,f,g){if(v)return O(18,1,a,b,c,d,e,f,g);e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var h=U(d),k=FS.X(h,a,e,b,c),l=k.s;E[f>>2]=k.W;F[g>>2]=l;return 0}catch(m){if("undefined"==typeof FS||"ErrnoError"!==m.name)throw m;return-m.A}}Oc.h="ipiiijpp";
function Pc(a,b,c,d,e,f){if(v)return O(19,1,a,b,c,d,e,f);f=-9007199254740992>f||9007199254740992<f?NaN:Number(f);try{var g=U(e);if(c&2){c=f;if(!FS.isFile(g.node.mode))throw new FS.g(43);if(!(d&2)){var h=z.slice(a,a+b);FS.da(g,h,c,b,d)}}}catch(k){if("undefined"==typeof FS||"ErrnoError"!==k.name)throw k;return-k.A}}Pc.h="ippiiij";
var Qc=(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(f,e);E[b>>2]=Number(f!=e);b=g=>{var h=Math.abs(g);return`UTC${0<=g?"-":"+"}${String(Math.floor(h/60)).padStart(2,"0")}${String(h%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(xg(a,z,c,17),xg(b,z,d,17)):(xg(a,z,d,17),xg(b,z,c,17))};Qc.h="vpppp";var Xc=()=>performance.timeOrigin+performance.now();Xc.h="d";var Tc=()=>Date.now();Tc.h="d";var dj=1;
function Rc(a,b,c){if(!(0<=a&&3>=a))return 28;if(0===a)a=Date.now();else if(dj)a=performance.timeOrigin+performance.now();else return 52;J[c>>3]=BigInt(Math.round(1E6*a));return 0}Rc.h="iijp";var Sc=()=>{};Sc.h="v";var Uc=a=>w(Q(a));Uc.h="vp";var Vc=()=>{Cf+=1;throw"unwind";};Vc.h="v";var Wc=()=>z.length;Wc.h="p";var Yc=()=>t?require("node:os").cpus().length:navigator.hardwareConcurrency;Yc.h="i";var Zc=a=>{Pi(a)};Zc.h="vp";
var $c=(a,b,c)=>{a=Oi.get(a);switch(b){case 0:a.resolve(c);break;case 1:a.resolve(Oi.get(c).promise);break;case 2:a.resolve(Oi.get(c).promise);Pi(c);break;case 3:a.reject(c)}};$c.h="vpip";var ad=()=>!1;ad.h="ip";
var ej={},gj=()=>{if(!fj){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:da||"./this.program"};t&&(a=process.env);for(var b in ej)void 0===ej[b]?delete a[b]:a[b]=ej[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);fj=c}return fj},fj;function bd(a,b){if(v)return O(20,1,a,b);var c=0,d=0,e;for(e of gj()){var f=b+c;F[a+d>>2]=f;c+=xg(e,z,f,Infinity)+1;d+=4}return 0}bd.h="ipp";
function cd(a,b){if(v)return O(21,1,a,b);var c=gj();F[a>>2]=c.length;a=0;for(var d of c)a+=wg(d)+1;F[b>>2]=a;return 0}cd.h="ipp";function ed(a){if(v)return O(22,1,a);try{var b=U(a);FS.close(b);return 0}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return c.A}}ed.h="ii";
function fd(a,b){if(v)return O(23,1,a,b);try{var c=U(a),d=c.tty?2:FS.isDir(c.mode)?3:FS.isLink(c.mode)?7:4;y[b]=d;B[b+2>>1]=0;J[b+8>>3]=BigInt(0);J[b+16>>3]=BigInt(0);return 0}catch(e){if("undefined"==typeof FS||"ErrnoError"!==e.name)throw e;return e.A}}fd.h="iip";
function gd(a,b,c,d){if(v)return O(24,1,a,b,c,d);try{a:{var e=U(a);a=b;for(var f,g=b=0;g<c;g++){var h=F[a>>2],k=F[a+4>>2];a+=8;var l=FS.read(e,y,h,k,f);if(0>l){var m=-1;break a}b+=l;if(l<k)break;"undefined"!=typeof f&&(f+=l)}m=b}F[d>>2]=m;return 0}catch(p){if("undefined"==typeof FS||"ErrnoError"!==p.name)throw p;return p.A}}gd.h="iippp";
function hd(a,b,c,d){if(v)return O(25,1,a,b,c,d);b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var e=U(a);FS.llseek(e,b,c);J[d>>3]=BigInt(e.position);e.Ga&&0===b&&0===c&&(e.Ga=null);return 0}catch(f){if("undefined"==typeof FS||"ErrnoError"!==f.name)throw f;return f.A}}hd.h="iijip";
function jd(a,b,c,d){if(v)return O(26,1,a,b,c,d);try{a:{var e=U(a);a=b;for(var f,g=b=0;g<c;g++){var h=F[a>>2],k=F[a+4>>2];a+=8;var l=FS.write(e,y,h,k,f);if(0>l){var m=-1;break a}b+=l;if(l<k)break;"undefined"!=typeof f&&(f+=l)}m=b}F[d>>2]=m;return 0}catch(p){if("undefined"==typeof FS||"ErrnoError"!==p.name)throw p;return p.A}}jd.h="iippp";function ld(...a){return K.heif_color_conversion_options_ext_copy(...a)}ld.L=!0;function md(...a){return K.heif_color_conversion_options_ext_free(...a)}md.L=!0;
function nd(...a){return K.heif_encoding_options_alloc(...a)}nd.L=!0;function od(...a){return K.heif_encoding_options_free(...a)}od.L=!0;function pd(...a){return K.heif_error_success(...a)}pd.L=!0;function qd(...a){return K.heif_image_get_plane_readonly2(...a)}qd.L=!0;function rd(...a){return K.heif_image_release(...a)}rd.L=!0;function sd(...a){return K.heif_nclx_color_profile_alloc(...a)}sd.L=!0;function td(...a){return K.heif_nclx_color_profile_free(...a)}td.L=!0;
function ud(...a){return K.heif_tai_clock_info_copy(...a)}ud.L=!0;function vd(...a){return K.heif_tai_clock_info_release(...a)}vd.L=!0;function wd(...a){return K.heif_tai_timestamp_packet_copy(...a)}wd.L=!0;function xd(...a){return K.heif_tai_timestamp_packet_release(...a)}xd.L=!0;function De(a,b){try{return Ag(z.subarray(a,a+b)),0}catch(c){if("undefined"==typeof FS||"ErrnoError"!==c.name)throw c;return c.A}}De.h="ipp";
var za=a=>{var b=N(),c=df(4),d=df(4);gf(a,c,d);a=F[c>>2];d=F[d>>2];c=Q(a);Ke(a);if(d){var e=Q(d);Ke(d)}M(b);return[c,e]};v||(uf={},tf=new Set);(()=>{var a={nb:Promise.resolve(),canHandle:b=>!n.noWasmDecoding&&b.endsWith(".so"),handle:async(b,c)=>a.nb=a.nb.then(async()=>{try{var d=await kg(b,{J:!0,ra:!0},c,{})}catch(e){throw Error(`failed to instantiate wasm: ${c}: ${e}`);}ng[c]=d;return b})};mg.push(a)})();FS.createPreloadedFile=(a,b,c,d,e,f,g,h,k,l)=>{ah(a,b,c,d,e,h,k,l).then(f).catch(g)};
FS.Jc=ah;FS.Ua();t&&NODEFS.Ua();if(!t)throw Error("NODERAWFS is currently only supported on Node.js environment.");function hj(){var a=Ug[ij];return function(...b){try{return a(...b)}catch(c){"BadResource"==c.name&&(c.code="EBADF");if(c.code)throw new FS.g(Qg[c.code]);throw c;}}}var Vg={...FS},ij;for(ij in Ug)FS[ij]=hj();
(()=>{let a=Vh.prototype;Object.assign(a,{isAliasOf:function(c){if(!(this instanceof Vh&&c instanceof Vh))return!1;var d=this.l.C.u,e=this.l.s;c.l=c.l;var f=c.l.C.u;for(c=c.l.s;d.P;)e=d.va(e),d=d.P;for(;f.P;)c=f.va(c),f=f.P;return d===f&&e===c},clone:function(){this.l.s||Nh(this);if(this.l.sa)return this.l.count.value+=1,this;var c=Rh,d=Object,e=d.create,f=Object.getPrototypeOf(this),g=this.l;c=c(e.call(d,f,{l:{value:{count:g.count,ja:g.ja,sa:g.sa,s:g.s,C:g.C,M:g.M,R:g.R}}}));c.l.count.value+=1;c.l.ja=
!1;return c},["delete"](){this.l.s||Nh(this);if(this.l.ja&&!this.l.sa)throw new X("Object already scheduled for deletion");Qh(this);var c=this.l;--c.count.value;0===c.count.value&&(c.M?c.R.$(c.M):c.C.u.$(c.s));this.l.sa||(this.l.M=void 0,this.l.s=void 0)},isDeleted:function(){return!this.l.s},deleteLater:function(){this.l.s||Nh(this);if(this.l.ja&&!this.l.sa)throw new X("Object already scheduled for deletion");Sh.push(this);1===Sh.length&&Uh&&Uh(Th);this.l.ja=!0;return this}});const b=Symbol.dispose;
b&&(a[b]=a["delete"])})();
Object.assign(ki.prototype,{Nb(a){this.ob&&(a=this.ob(a));return a},$a(a){this.$?.(a)},N:Eh,B:function(a){function b(){return this.Aa?ji(this.u.ba,{C:this.fc,s:c,R:this,M:a}):ji(this.u.ba,{C:this,s:a})}var c=this.Nb(a);if(!c)return this.$a(a),null;var d=ii(this.u,c);if(void 0!==d){if(0===d.l.count.value)return d.l.s=c,d.l.M=a,d.clone();d=d.clone();this.$a(a);return d}d=this.u.Lb(c);d=Wh[d];if(!d)return b.call(this);d=this.za?d.Bb:d.pointerType;var e=gi(c,this.u,d.u);return null===e?b.call(this):this.Aa?
ji(d.u.ba,{C:d,s:e,R:this,M:a}):ji(d.u.ba,{C:d,s:e})}});yf.push(()=>{ej.TMPDIR=require("node:os").tmpdir()});cb.push(()=>{const a=Object.getOwnPropertyDescriptor(n.SourceCustom.prototype,"onRead");Object.defineProperty(n.SourceCustom.prototype,"onRead",{set(c){return a.set.call(this,d=>ei(c(d)))}});const b=Object.getOwnPropertyDescriptor(n.TargetCustom.prototype,"onWrite");Object.defineProperty(n.TargetCustom.prototype,"onWrite",{set(c){return b.set.call(this,d=>c(Z(d)))}})});
Object.assign(Vh.prototype,{preventAutoDelete:function(){const a=Sh.indexOf(this);-1<a&&Sh.splice(a,1);this.l.ja=!1;return this}});if(!v){if(n.wasmMemory)Ha=n.wasmMemory;else{var jj=n.INITIAL_MEMORY||1073741824;Ha=new WebAssembly.Memory({initial:jj/65536,maximum:jj/65536,shared:!0})}Ia()}n.preloadPlugins&&(mg=n.preloadPlugins);n.noExitRuntime&&(Df=n.noExitRuntime);n.print&&(ra=n.print);n.printErr&&(w=n.printErr);n.dynamicLibraries&&(sa=n.dynamicLibraries);n.wasmBinary&&(ta=n.wasmBinary);
n.arguments&&(ca=n.arguments);n.thisProgram&&(da=n.thisProgram);if(n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.shift()();n.ENV=ej;n.addRunDependency=Zg;n.removeRunDependency=Yg;n.addFunction=Zf;n.FS_preloadFile=ah;n.FS_unlink=(...a)=>FS.unlink(...a);n.FS_createPath=(...a)=>FS.createPath(...a);n.FS_createDevice=(...a)=>FS.createDevice(...a);n.FS=FS;n.FS_createDataFile=(...a)=>FS.createDataFile(...a);n.FS_createLazyFile=(...a)=>FS.createLazyFile(...a);
n.setAutoDeleteLater=a=>{Oh=a};n.deletionQueue=Sh;n.setDelayFunction=a=>{Uh=a;Sh.length&&Uh&&Uh(Th)};n.incrementExceptionRefcount=a=>ff(a instanceof ya?a.ga:a);n.decrementExceptionRefcount=a=>ef(a instanceof ya?a.ga:a);n.getExceptionMessage=a=>za(a instanceof ya?a.ga:a);var Vi=[Ce,Ff,vh,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Lb,nc,Oc,Pc,bd,cd,ed,fd,gd,hd,jd],gg={};
function kj(a){for(var b=C[a+6>>1];13===b&&!(16<F[a>>2]);){var c=F[a+8>>2],d=F[c>>2];if(0===d){b=0;break}else if(0===F[(c>>2)+1])a=d,b=C[d+6>>1];else break}return[a,b]}
function kd(a,b,c,d){var e=F[(a>>2)+1],f=F[(a>>2)+6],g=F[(a>>2)+2],h=F[(a>>2)+5];a=kj(F[(a>>2)+3])[1];var k=N(),l=k,m=[],p=!1;if(15===a)throw Error("complex ret marshalling nyi");if(0>a||15<a)throw Error("Unexpected rtype "+a);if(4===a||13===a)m.push(c),p=!0;for(var r=0;r<f;r++){var q=F[(d>>2)+r],u=kj(F[(g>>2)+r]),A=u[0];u=u[1];switch(u){case 1:case 10:case 9:m.push(F[q>>2]);break;case 2:m.push(Ua[q>>2]);break;case 3:m.push(Va[q>>3]);break;case 5:m.push(z[q]);break;case 6:m.push(y[q]);break;case 7:m.push(C[q>>
1]);break;case 8:m.push(B[q>>1]);break;case 11:case 12:m.push(Wa[q>>3]);break;case 4:m.push(Wa[q>>3]);m.push(Wa[(q>>3)+1]);break;case 13:u=F[A>>2];A=C[A+4>>1];l-=u;l&=~(A-1);y.subarray(l,l+u).set(y.subarray(q,q+u));m.push(l);break;case 14:m.push(F[q>>2]);break;case 15:throw Error("complex marshalling nyi");default:throw Error("Unexpected type "+u);}}if(h&1){h=[];for(r=e-1;r>=f;r--)switch(q=F[(d>>2)+r],u=kj(F[(g>>2)+r]),A=u[0],u=u[1],u){case 5:case 6:--l;l&=-1;z[l]=z[q];break;case 7:case 8:l-=2;l&=
-2;C[l>>1]=C[q>>1];break;case 1:case 9:case 10:case 2:l-=4;l&=-4;F[l>>2]=F[q>>2];break;case 3:case 11:case 12:l-=8;l&=-8;F[l>>2]=F[q>>2];F[(l>>2)+1]=F[(q>>2)+1];break;case 4:l-=16;l&=-8;F[l>>2]=F[q>>2];F[(l>>2)+1]=F[(q>>2)+1];F[(l>>2)+2]=F[(q>>2)+2];F[(l>>2)+3]=F[(q>>2)+3];break;case 13:l-=4;l&=-4;h.push([l,q,F[A>>2],C[A+4>>1]]);break;case 14:l-=4;l&=-4;F[l>>2]=F[q>>2];break;case 15:throw Error("complex arg marshalling nyi");default:throw Error("Unexpected argtype "+u);}m.push(l);for(r=0;r<h.length;r++)e=
h[r],d=e[0],q=e[1],u=e[2],A=e[3],l-=u,l&=~(A-1),y.subarray(l,l+u).set(y.subarray(q,q+u)),F[d>>2]=l}M(l);df(0);b=P(b).apply(null,m);M(k);if(!p)switch(a){case 0:break;case 1:case 9:case 10:F[c>>2]=b;break;case 2:Ua[c>>2]=b;break;case 3:Va[c>>3]=b;break;case 5:case 6:z[c+0]=b;break;case 7:case 8:C[c>>1]=b;break;case 11:case 12:Wa[c>>3]=b;break;case 14:F[c>>2]=b;break;case 15:throw Error("complex ret marshalling nyi");default:throw Error("Unexpected rtype "+a);}}kd.h="viiii";
var Ie,Je,Ke,Le,Me,Ne,Pa,Oe,Pe,Qe,Re,Se,Te,Ue,Ve,Ma,Ta,We,Xe,Ye,Ze,$e,af,L,bf,cf,M,df,N,ef,ff,gf,hf,jf,lf,kf,K;function ae(a,b){var c=N();try{P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0)}}function je(a,b,c,d){var e=N();try{P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}function Id(a,b,c){var d=N();try{return P(a)(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0)}}function Gd(a){var b=N();try{return P(a)()}catch(c){M(b);if(!(c instanceof x))throw c;L(1,0)}}
function $d(a){var b=N();try{P(a)()}catch(c){M(b);if(!(c instanceof x))throw c;L(1,0)}}function Hd(a,b){var c=N();try{return P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0)}}function re(a,b,c,d,e,f){var g=N();try{P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}function Kd(a,b,c,d){var e=N();try{return P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}function qe(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}
function Nd(a,b,c,d,e,f){var g=N();try{return P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}function ee(a,b,c){var d=N();try{P(a)(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0)}}function Qd(a,b,c,d,e,f,g){var h=N();try{return P(a)(b,c,d,e,f,g)}catch(k){M(h);if(!(k instanceof x))throw k;L(1,0)}}function Bd(a,b,c,d,e,f){var g=N();try{return P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}
function Ld(a,b,c,d,e){var f=N();try{return P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}function Ad(a,b,c,d){var e=N();try{return P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}function fe(a,b,c,d){var e=N();try{P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}function ge(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}
function Jd(a,b,c,d){var e=N();try{return P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}function be(a,b,c){var d=N();try{P(a)(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0)}}function yd(a,b){var c=N();try{return P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0)}}function xe(a,b,c,d,e,f,g,h,k,l,m){var p=N();try{P(a)(b,c,d,e,f,g,h,k,l,m)}catch(r){M(p);if(!(r instanceof x))throw r;L(1,0)}}
function se(a,b,c,d,e,f,g){var h=N();try{P(a)(b,c,d,e,f,g)}catch(k){M(h);if(!(k instanceof x))throw k;L(1,0)}}function te(a,b,c,d,e,f,g,h){var k=N();try{P(a)(b,c,d,e,f,g,h)}catch(l){M(k);if(!(l instanceof x))throw l;L(1,0)}}function zd(a,b,c){var d=N();try{return P(a)(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0)}}function ie(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}
function ke(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}function ce(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}function ne(a,b,c,d,e,f,g,h){var k=N();try{P(a)(b,c,d,e,f,g,h)}catch(l){M(k);if(!(l instanceof x))throw l;L(1,0)}}function le(a,b,c,d,e,f,g,h,k,l){var m=N();try{P(a)(b,c,d,e,f,g,h,k,l)}catch(p){M(m);if(!(p instanceof x))throw p;L(1,0)}}
function me(a,b,c,d,e,f,g,h,k){var l=N();try{P(a)(b,c,d,e,f,g,h,k)}catch(m){M(l);if(!(m instanceof x))throw m;L(1,0)}}function pe(a,b,c,d,e,f){var g=N();try{P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}function oe(a,b,c,d,e,f,g){var h=N();try{P(a)(b,c,d,e,f,g)}catch(k){M(h);if(!(k instanceof x))throw k;L(1,0)}}function ze(a,b,c,d,e,f,g,h,k,l,m,p,r){var q=N();try{P(a)(b,c,d,e,f,g,h,k,l,m,p,r)}catch(u){M(q);if(!(u instanceof x))throw u;L(1,0)}}
function ye(a,b,c,d,e,f,g,h,k,l,m,p){var r=N();try{P(a)(b,c,d,e,f,g,h,k,l,m,p)}catch(q){M(r);if(!(q instanceof x))throw q;L(1,0)}}function we(a,b,c,d,e,f,g,h,k,l){var m=N();try{P(a)(b,c,d,e,f,g,h,k,l)}catch(p){M(m);if(!(p instanceof x))throw p;L(1,0)}}function ve(a,b,c,d,e,f,g,h,k){var l=N();try{P(a)(b,c,d,e,f,g,h,k)}catch(m){M(l);if(!(m instanceof x))throw m;L(1,0)}}
function Ae(a,b,c,d,e,f,g,h,k,l,m,p,r,q){var u=N();try{P(a)(b,c,d,e,f,g,h,k,l,m,p,r,q)}catch(A){M(u);if(!(A instanceof x))throw A;L(1,0)}}function he(a,b,c,d,e,f){var g=N();try{P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}function Rd(a,b,c,d,e,f,g,h){var k=N();try{return P(a)(b,c,d,e,f,g,h)}catch(l){M(k);if(!(l instanceof x))throw l;L(1,0)}}function Yd(a,b){var c=N();try{return P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0);return 0n}}
function Wd(a,b,c,d,e,f,g,h,k,l,m,p,r){var q=N();try{return P(a)(b,c,d,e,f,g,h,k,l,m,p,r)}catch(u){M(q);if(!(u instanceof x))throw u;L(1,0)}}function Td(a,b,c,d,e,f,g,h,k,l){var m=N();try{return P(a)(b,c,d,e,f,g,h,k,l)}catch(p){M(m);if(!(p instanceof x))throw p;L(1,0)}}function ue(a,b,c,d,e,f,g,h,k,l){var m=N();try{P(a)(b,c,d,e,f,g,h,k,l)}catch(p){M(m);if(!(p instanceof x))throw p;L(1,0)}}
function Od(a,b,c,d,e,f,g,h,k){var l=N();try{return P(a)(b,c,d,e,f,g,h,k)}catch(m){M(l);if(!(m instanceof x))throw m;L(1,0)}}function Ed(a,b,c){var d=N();try{return P(a)(b,c)}catch(e){M(d);if(!(e instanceof x))throw e;L(1,0)}}function Sd(a,b,c,d,e,f,g,h,k){var l=N();try{return P(a)(b,c,d,e,f,g,h,k)}catch(m){M(l);if(!(m instanceof x))throw m;L(1,0)}}function de(a,b,c,d,e){var f=N();try{P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0)}}
function Cd(a,b){var c=N();try{return P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0)}}function Dd(a,b){var c=N();try{return P(a)(b)}catch(d){M(c);if(!(d instanceof x))throw d;L(1,0)}}function Pd(a,b,c,d,e,f,g,h,k,l,m){var p=N();try{return P(a)(b,c,d,e,f,g,h,k,l,m)}catch(r){M(p);if(!(r instanceof x))throw r;L(1,0)}}function Xd(a,b,c,d,e,f){var g=N();try{return P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}
function Md(a,b,c,d,e,f){var g=N();try{return P(a)(b,c,d,e,f)}catch(h){M(g);if(!(h instanceof x))throw h;L(1,0)}}function Ud(a,b,c,d,e,f,g,h,k,l,m){var p=N();try{return P(a)(b,c,d,e,f,g,h,k,l,m)}catch(r){M(p);if(!(r instanceof x))throw r;L(1,0)}}function Zd(a,b,c,d,e){var f=N();try{return P(a)(b,c,d,e)}catch(g){M(f);if(!(g instanceof x))throw g;L(1,0);return 0n}}function Fd(a,b,c,d){var e=N();try{return P(a)(b,c,d)}catch(f){M(e);if(!(f instanceof x))throw f;L(1,0)}}
function Vd(a,b,c,d,e,f,g,h,k,l,m,p){var r=N();try{return P(a)(b,c,d,e,f,g,h,k,l,m,p)}catch(q){M(r);if(!(q instanceof x))throw q;L(1,0)}}function Be(a,b,c,d,e,f,g,h,k,l,m,p,r,q,u,A){var G=N();try{P(a)(b,c,d,e,f,g,h,k,l,m,p,r,q,u,A)}catch(D){M(G);if(!(D instanceof x))throw D;L(1,0)}}function lj(a=[]){var b=fg("main").Va;if(b){a.unshift(da);var c=a.length,d=df(4*(c+1)),e=d,f;for(f of a)F[e>>2]=yg(f),e+=4;F[e>>2]=0;try{var g=b(c,d);dd(g,!0)}catch(h){Mi(h)}}}
function Ka(a=ca){function b(){n.calledRun=!0;if(!va&&($a(),Aa?.(n),n.onRuntimeInitialized?.(),n.noInitialRun||lj(a),!v)){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var c=n.postRun.shift();Jf.push(c)}ab(Jf)}}if(0<Wg)Xg=Ka;else if(v)Aa?.(n),$a();else{if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)yf.push(n.preRun.shift());ab(yf);0<Wg?Xg=Ka:n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),
1);b()},1)):b()}}var bb;v||(bb=await (Ja()),Ka());Xa?moduleRtn=n:moduleRtn=new Promise((a,b)=>{Aa=a;Ba=b});
;return moduleRtn}export default Vips;var isPthread=globalThis.name=="em-pthread";var isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(isNode)isPthread=(await import("node:worker_threads")).workerData==="em-pthread";isPthread&&Vips();
